Skip to content

Commit cb6999c

Browse files
andyxningamitm02
authored andcommitted
[BUGFIX] catch subclass first for try...except (vllm-project#18672)
Signed-off-by: Andy Xie <andy.xning@gmail.com> Signed-off-by: amit <amit.man@gmail.com>
1 parent 6393454 commit cb6999c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

vllm/model_executor/model_loader/weight_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ def download_safetensors_index_file_from_hf(
319319
320320
Args:
321321
model_name_or_path (str): The model name or path.
322+
index_file (str): The safetensors index file name
322323
cache_dir (Optional[str]): The cache directory to store the model
323324
weights. If None, will use HF defaults.
324325
revision (Optional[str]): The revision of the model.
@@ -337,10 +338,10 @@ def download_safetensors_index_file_from_hf(
337338
)
338339
# If file not found on remote or locally, we should not fail since
339340
# only some models will have index_file.
340-
except huggingface_hub.utils.EntryNotFoundError:
341-
logger.info("No %s found in remote.", index_file)
342341
except huggingface_hub.utils.LocalEntryNotFoundError:
343342
logger.info("No %s found in local cache.", index_file)
343+
except huggingface_hub.utils.EntryNotFoundError:
344+
logger.info("No %s found in remote.", index_file)
344345

345346

346347
# For models like Mistral-7B-v0.3, there are both sharded

0 commit comments

Comments
 (0)