Cleanup some huggingface_hub-related stuff (#32788)

This commit is contained in:
Lucain
2026-01-22 03:38:17 +00:00
committed by GitHub
parent 378385b90c
commit 24a163ed77
3 changed files with 9 additions and 50 deletions
+2 -12
View File
@@ -5,12 +5,7 @@ import os
from typing import TYPE_CHECKING, Optional
import huggingface_hub
from huggingface_hub.utils import (
EntryNotFoundError,
HfHubHTTPError,
HFValidationError,
RepositoryNotFoundError,
)
from huggingface_hub.utils import HfHubHTTPError, HFValidationError
from torch import nn
from transformers import PretrainedConfig
@@ -243,12 +238,7 @@ def get_adapter_absolute_path(lora_path: str) -> str:
# If the path does not exist locally, assume it's a Hugging Face repo.
try:
local_snapshot_path = huggingface_hub.snapshot_download(repo_id=lora_path)
except (
HfHubHTTPError,
RepositoryNotFoundError,
EntryNotFoundError,
HFValidationError,
):
except (HfHubHTTPError, HFValidationError):
# Handle errors that may occur during the download
# Return original path instead of throwing error here
logger.exception("Error downloading the HuggingFace model")