[BugFix] Fix a bug in loading safetensors (#1732)
This commit is contained in:
parent
32c927b53f
commit
f5a37c6c6c
@ -240,7 +240,7 @@ def hf_model_weights_iterator(
|
||||
elif use_safetensors:
|
||||
for st_file in hf_weights_files:
|
||||
with safe_open(st_file, framework="pt") as f:
|
||||
for name in f:
|
||||
for name in f.keys(): # noqa: SIM118
|
||||
param = f.get_tensor(name)
|
||||
yield name, param
|
||||
else:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user