提交 6a04a7f2 编写于 作者: A AUTOMATIC

fix an error loading Lora with empty values in metadata

上级 8b35b64e
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册