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 -1
View File
@@ -22,6 +22,7 @@ import pytest
from packaging import version
from vllm.platforms import current_platform
from vllm.transformers_utils.repo_utils import hf_api
if current_platform.is_rocm():
from vllm.platforms.rocm import on_gfx950
@@ -47,7 +48,7 @@ QUARK_MXFP4_AVAILABLE = importlib.util.find_spec("quark") is not None and versio
def has_huggingface_access(repo):
try:
huggingface_hub.list_repo_refs(repo)
hf_api().list_repo_refs(repo)
return True
except huggingface_hub.errors.RepositoryNotFoundError:
return False