mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
fix(sdnq): restore safe_open key iteration
safe_open exposes keys() but implements no __iter__, so the dict idiom applied
in d11a619a6 raises TypeError on every non-streamer load of a pre-quantized
checkpoint. The threaded method reaches the same loop, since load_threaded
delegates one file at a time.
This commit is contained in:
@@ -19,7 +19,7 @@ def load_safetensors(files: list[str], state_dict: dict | None = None, key_mappi
|
||||
state_dict = {}
|
||||
for fn in files:
|
||||
with safe_open(fn, framework="pt", device=str(device)) as f:
|
||||
for key in f:
|
||||
for key in f.keys(): # safe_open exposes keys() but is not iterable
|
||||
state_dict[map_keys(key, key_mapping)] = f.get_tensor(key)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user