Farhan Beg commited on
Commit
d434dcb
·
1 Parent(s): b047e12

chore(sync): replace deprecated HF_HUB_ENABLE_HF_TRANSFER with HF_XET_HIGH_PERFORMANCE

Browse files

huggingface_hub 0.30+ deprecated the legacy hf_transfer flag and emits a
FutureWarning at import time when it's set. Switch to the new Xet flag
so the warning stops appearing in Space logs and we actually get the
high-performance transfer on current hub versions.

Files changed (1) hide show
  1. hermes-sync.py +6 -1
hermes-sync.py CHANGED
@@ -22,7 +22,12 @@ from pathlib import Path
22
  os.environ.setdefault("HF_HUB_DISABLE_PROGRESS_BARS", "1")
23
  os.environ.setdefault("HF_HUB_VERBOSITY", "error")
24
  os.environ.setdefault("HF_HUB_DOWNLOAD_TIMEOUT", "300")
25
- os.environ.setdefault("HF_HUB_ENABLE_HF_TRANSFER", "1")
 
 
 
 
 
26
 
27
  from huggingface_hub import HfApi, snapshot_download, upload_folder
28
  from huggingface_hub.errors import HfHubHTTPError, RepositoryNotFoundError
 
22
  os.environ.setdefault("HF_HUB_DISABLE_PROGRESS_BARS", "1")
23
  os.environ.setdefault("HF_HUB_VERBOSITY", "error")
24
  os.environ.setdefault("HF_HUB_DOWNLOAD_TIMEOUT", "300")
25
+ # huggingface_hub 0.30+ replaced HF_HUB_ENABLE_HF_TRANSFER with this flag;
26
+ # the legacy var triggers a FutureWarning at import on newer hubs and is
27
+ # silently ignored. Setting only the new var means older hubs miss the
28
+ # transfer accelerator (which is fine — they fall back to the standard
29
+ # downloader) but no version emits a deprecation warning.
30
+ os.environ.setdefault("HF_XET_HIGH_PERFORMANCE", "1")
31
 
32
  from huggingface_hub import HfApi, snapshot_download, upload_folder
33
  from huggingface_hub.errors import HfHubHTTPError, RepositoryNotFoundError