From: Nicolas Patry Date: Wed, 30 Nov 2022 13:46:38 +0000 (+0100) Subject: Supporting stable-diffusion by default. (#117) X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=61c8eaf6567429739e6c45fc85c656eeb8f4ef74;p=safetensors.git Supporting stable-diffusion by default. (#117) --- diff --git a/bindings/python/convert.py b/bindings/python/convert.py index c116da0..e2965c4 100644 --- a/bindings/python/convert.py +++ b/bindings/python/convert.py @@ -96,6 +96,8 @@ def convert_file( sf_filename: str, ): loaded = torch.load(pt_filename) + if "state_dict" in loaded: + loaded = loaded["state_dict"] shared = shared_pointers(loaded) for shared_weights in shared: for name in shared_weights[1:]: