mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-06-09 12:39:23 -03:00
fix(utils): catch MemoryError in read_safetensors_metadata for non-safetensors files
This commit is contained in:
@@ -81,7 +81,7 @@ def read_safetensors_metadata(file_path: str) -> dict[str, Any]:
|
||||
return {}
|
||||
header = json.loads(header_bytes.decode("utf-8"))
|
||||
return header.get("__metadata__", {})
|
||||
except (OSError, json.JSONDecodeError, UnicodeDecodeError, struct.error):
|
||||
except (OSError, json.JSONDecodeError, UnicodeDecodeError, struct.error, MemoryError, Exception):
|
||||
return {}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user