Make bare hugging_face imports forbidden (#49726)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
Harry Mellor
2026-07-25 04:18:39 -07:00
committed by GitHub
co-authored by Andreas Karatzas
parent 0b1a8bb1f6
commit ca0defa343
29 changed files with 199 additions and 106 deletions
+2 -2
View File
@@ -42,12 +42,12 @@ def _skip(msg: str) -> NoReturn:
def _snapshot_download_or_skip(model_id: str) -> str:
try:
from huggingface_hub import snapshot_download
from vllm.transformers_utils.repo_utils import hf_api
except Exception as e: # pragma: no cover
_skip(f"huggingface_hub is required to download {model_id}: {e}")
try:
return snapshot_download(
return hf_api().snapshot_download(
repo_id=model_id,
repo_type="model",
# These checkpoints are already small; download full repo for simplicity.