Added rescaling, locon, sdxl, all kinds of stuff. sdxl is still weird
This commit is contained in:
1 parent
40e60fa021
commit
d3ad195b51
11 files changed
+548
-45
No files matched your search
+10
-1
@@ -1,5 +1,8 @@
|
||||
import json
|
||||
from collections import OrderedDict
|
||||
|
||||
from safetensors import safe_open
|
||||
|
||||
from info import software_meta
|
||||
|
||||
|
||||
@@ -25,4 +28,10 @@ def parse_metadata_from_safetensors(meta: OrderedDict) -> OrderedDict:
|
||||
parsed_meta[key] = json.loads(value)
|
||||
except json.decoder.JSONDecodeError:
|
||||
parsed_meta[key] = value
|
||||
return meta
|
||||
return parsed_meta
|
||||
|
||||
|
||||
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)
|
||||
Reference in new issue
Block a user