Spaces:
Running
on
Zero
Running
on
Zero
demo
Browse files
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,
|