[BugFix] Fix a bug in loading safetensors (#1732)

This commit is contained in:
Woosuk Kwon 2023-11-20 15:51:18 -08:00 committed by GitHub
parent 32c927b53f
commit f5a37c6c6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: