Skip to content

Commit

Permalink
fix an error loading Lora with empty values in metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
AUTOMATIC1111 committed Mar 14, 2023
1 parent 8b35b64 commit 6a04a7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/sd_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def read_metadata_from_safetensors(filename):
res = {}
for k, v in json_obj.get("__metadata__", {}).items():
res[k] = v
if isinstance(v, str) and v[0] == '{':
if isinstance(v, str) and v[0:1] == '{':
try:
res[k] = json.loads(v)
except Exception as e:
Expand Down

0 comments on commit 6a04a7f

Please sign in to comment.