Bug fixes, negative prompting during training, hardened catching

This commit is contained in:
Jaret Burkett
2023-11-24 07:25:11 -07:00
parent fbec68681d
commit d7e55b6ad4
6 changed files with 93 additions and 9 deletions

View File

@@ -77,6 +77,10 @@ def parse_metadata_from_safetensors(meta: OrderedDict) -> OrderedDict:
def load_metadata_from_safetensors(file_path: str) -> OrderedDict:
with safe_open(file_path, framework="pt") as f:
metadata = f.metadata()
return parse_metadata_from_safetensors(metadata)
try:
with safe_open(file_path, framework="pt") as f:
metadata = f.metadata()
return parse_metadata_from_safetensors(metadata)
except Exception as e:
print(f"Error loading metadata from {file_path}: {e}")
return OrderedDict()