From f5a37c6c6c8204ec42187525ebdb8288cfc4b552 Mon Sep 17 00:00:00 2001 From: Woosuk Kwon Date: Mon, 20 Nov 2023 15:51:18 -0800 Subject: [PATCH] [BugFix] Fix a bug in loading safetensors (#1732) --- vllm/model_executor/weight_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vllm/model_executor/weight_utils.py b/vllm/model_executor/weight_utils.py index 8c17d9c635c73..825b9016288c6 100644 --- a/vllm/model_executor/weight_utils.py +++ b/vllm/model_executor/weight_utils.py @@ -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: