weijielyu commited on
Commit
6132ce7
·
1 Parent(s): f423985
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -100,6 +100,14 @@ def download_weights_from_hf() -> Path:
100
  print(f"Downloading model weights from HuggingFace: {HF_REPO_ID}")
101
  print("This may take a few minutes on first run...")
102
 
 
 
 
 
 
 
 
 
103
  # Download to local directory
104
  snapshot_download(
105
  repo_id=HF_REPO_ID,
 
100
  print(f"Downloading model weights from HuggingFace: {HF_REPO_ID}")
101
  print("This may take a few minutes on first run...")
102
 
103
+ # Disable fast transfer if hf_transfer is not installed
104
+ if os.environ.get("HF_HUB_ENABLE_HF_TRANSFER") == "1":
105
+ try:
106
+ import hf_transfer
107
+ except ImportError:
108
+ print("hf_transfer not available, disabling fast download")
109
+ os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "0"
110
+
111
  # Download to local directory
112
  snapshot_download(
113
  repo_id=HF_REPO_ID,