Spaces:
Running on Zero
Running on Zero
fix(deploy): align demucs warmup to runtime model name (htdemucs not htdemucs_ft)
Browse files
app.py
CHANGED
|
@@ -145,7 +145,7 @@ def _bootstrap_spaces_cache() -> None:
|
|
| 145 |
|
| 146 |
|
| 147 |
def _warm_demucs_on_spaces() -> None:
|
| 148 |
-
"""Pre-download Demucs
|
| 149 |
|
| 150 |
Demucs hosts its weights on dl.fbaipublicfiles.com, not HF Hub, so
|
| 151 |
preload_from_hub can't fetch them. We trigger the download at module load
|
|
@@ -158,10 +158,10 @@ def _warm_demucs_on_spaces() -> None:
|
|
| 158 |
from demucs.pretrained import get_model
|
| 159 |
|
| 160 |
# Calling get_model triggers the download + cache. Discard the result.
|
| 161 |
-
get_model("
|
| 162 |
except Exception as e:
|
| 163 |
# Warmup is best-effort. Surface in the log but don't crash startup.
|
| 164 |
-
print(f"[warmup] demucs
|
| 165 |
|
| 166 |
|
| 167 |
_GPU_BASE_BY_MODE = {
|
|
|
|
| 145 |
|
| 146 |
|
| 147 |
def _warm_demucs_on_spaces() -> None:
|
| 148 |
+
"""Pre-download Demucs htdemucs so first stem request is fast.
|
| 149 |
|
| 150 |
Demucs hosts its weights on dl.fbaipublicfiles.com, not HF Hub, so
|
| 151 |
preload_from_hub can't fetch them. We trigger the download at module load
|
|
|
|
| 158 |
from demucs.pretrained import get_model
|
| 159 |
|
| 160 |
# Calling get_model triggers the download + cache. Discard the result.
|
| 161 |
+
get_model("htdemucs")
|
| 162 |
except Exception as e:
|
| 163 |
# Warmup is best-effort. Surface in the log but don't crash startup.
|
| 164 |
+
print(f"[warmup] demucs htdemucs preload skipped: {e}", flush=True)
|
| 165 |
|
| 166 |
|
| 167 |
_GPU_BASE_BY_MODE = {
|