From b84cbc78eee537936c9b2eb1fa80e640b8997742 Mon Sep 17 00:00:00 2001 From: lopho Date: Mon, 24 Nov 2025 01:00:22 +0100 Subject: [PATCH] avoid exception when accessing removed constant HF_HUB_ENABLE_HF_TRANSFER HF_HUB_ENABLE_HF_TRANSFER constant was removed from huggingface_hub. --- hfutils/index/fetch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hfutils/index/fetch.py b/hfutils/index/fetch.py index 17f37c007f2..7460b2d72f0 100644 --- a/hfutils/index/fetch.py +++ b/hfutils/index/fetch.py @@ -699,7 +699,7 @@ def _hf_tar_file_info_write(repo_id: str, archive_in_repo: str, file_in_archive: def _check_hf_transfer_conflict(): - if constants.HF_HUB_ENABLE_HF_TRANSFER and vpip('huggingface_hub') < '0.31': + if vpip('huggingface_hub') < '0.31' and constants.HF_HUB_ENABLE_HF_TRANSFER: warnings.warn(f"You are trying to use huggingface_hub=={huggingface_hub.__version__} " f"with hf_transfer enabled at the same time, this may cause unexpected error " f"(see: https://github.com/huggingface/huggingface_hub/issues/2978 for more details). "