mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-29 19:05:05 +08:00
fix an error loading Lora with empty values in metadata
This commit is contained in:
parent
8b35b64e11
commit
6a04a7f20f
@ -225,7 +225,7 @@ def read_metadata_from_safetensors(filename):
|
|||||||
res = {}
|
res = {}
|
||||||
for k, v in json_obj.get("__metadata__", {}).items():
|
for k, v in json_obj.get("__metadata__", {}).items():
|
||||||
res[k] = v
|
res[k] = v
|
||||||
if isinstance(v, str) and v[0] == '{':
|
if isinstance(v, str) and v[0:1] == '{':
|
||||||
try:
|
try:
|
||||||
res[k] = json.loads(v)
|
res[k] = json.loads(v)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user