@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 7a8987dac5
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 16, 00:45 UTC

[Bugfix] Gracefully handle huggingface hub http error (#12571)

Roger Wang committed Jan 31, 2025 at 00:19 UTC 7a8987dac5f0ed0c798a73e8b4ec8f5e640bc63a
1 file changed +9 -1
vllm/transformers_utils/config.py
+9 -1
@@ -7,7 +7,8 @@ from typing import Any, Dict, Optional, Type, Union
7 import huggingface_hub
8 from huggingface_hub import (file_exists, hf_hub_download,
9 try_to_load_from_cache)
10 -from huggingface_hub.utils import (EntryNotFoundError, LocalEntryNotFoundError,
10 +from huggingface_hub.utils import (EntryNotFoundError, HfHubHTTPError,
11 + LocalEntryNotFoundError,
12 RepositoryNotFoundError,
13 RevisionNotFoundError)
14 from torch import nn
@@ -294,6 +295,13 @@ def get_hf_file_to_dict(file_name: str,
295 logger.debug("File or repository not found in hf_hub_download",
296 e)
297 return None
298 + except HfHubHTTPError as e:
299 + logger.warning(
300 + "Cannot connect to Hugging Face Hub. Skipping file "
301 + "download for '%s':",
302 + file_name,
303 + exc_info=e)
304 + return None
305 file_path = Path(hf_hub_file)
306
307 with open(file_path) as file: