diff --git a/vllm/transformers_utils/config.py b/vllm/transformers_utils/config.py index c97acffa1a719..5805f4ad0b7f7 100644 --- a/vllm/transformers_utils/config.py +++ b/vllm/transformers_utils/config.py @@ -7,7 +7,8 @@ from typing import Any, Dict, Optional, Type, Union import huggingface_hub from huggingface_hub import (file_exists, hf_hub_download, try_to_load_from_cache) -from huggingface_hub.utils import (EntryNotFoundError, LocalEntryNotFoundError, +from huggingface_hub.utils import (EntryNotFoundError, HfHubHTTPError, + LocalEntryNotFoundError, RepositoryNotFoundError, RevisionNotFoundError) from torch import nn @@ -294,6 +295,13 @@ def get_hf_file_to_dict(file_name: str, logger.debug("File or repository not found in hf_hub_download", e) return None + except HfHubHTTPError as e: + logger.warning( + "Cannot connect to Hugging Face Hub. Skipping file " + "download for '%s':", + file_name, + exc_info=e) + return None file_path = Path(hf_hub_file) with open(file_path) as file: