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:
CalamitousFelicitousness
2026-07-25 22:14:53 +01:00
parent 76d76be4b7
commit 4e20c43f8c
+1 -1
View File
@@ -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)