Spaces:
Running on Zero
Running on Zero
Fix: Increase generator dynamic timeout headroom (55s, 75s, 100s)
Browse files
app.py
CHANGED
|
@@ -472,18 +472,18 @@ def fetch_remote_conditioning(
|
|
| 472 |
# 8. LOGIKA RUNNER ZERO-OVERHEAD @SPACES.GPU (DYNAMIC DURATION)
|
| 473 |
# ============================================================
|
| 474 |
DURATION_GPU_MAP = {
|
| 475 |
-
5.0:
|
| 476 |
-
10.0:
|
| 477 |
-
15.0:
|
| 478 |
}
|
| 479 |
|
| 480 |
def get_generator_duration(safetensors_path: str, video_duration: float | str = 5.0, seed: int = 0) -> int:
|
| 481 |
-
"""Kalkulasi alokasi waktu GPU ZeroGPU dinamis dan
|
| 482 |
try:
|
| 483 |
dur_val = float(str(video_duration).replace("s", "").strip())
|
| 484 |
except Exception:
|
| 485 |
dur_val = 5.0
|
| 486 |
-
return DURATION_GPU_MAP.get(dur_val, int(min(max(
|
| 487 |
|
| 488 |
def _load_base_workflow() -> dict[str, Any]:
|
| 489 |
with open(WORKFLOW_FILE, "r", encoding="utf-8") as f:
|
|
|
|
| 472 |
# 8. LOGIKA RUNNER ZERO-OVERHEAD @SPACES.GPU (DYNAMIC DURATION)
|
| 473 |
# ============================================================
|
| 474 |
DURATION_GPU_MAP = {
|
| 475 |
+
5.0: 55, # Waktu riil ~35s -> Minta 55s (ZeroGPU reserve: 82.5s)
|
| 476 |
+
10.0: 75, # Waktu riil ~55s -> Minta 75s (ZeroGPU reserve: 112.5s)
|
| 477 |
+
15.0: 100, # Waktu riil ~74.6s -> Minta 100s (ZeroGPU reserve: 150.0s)
|
| 478 |
}
|
| 479 |
|
| 480 |
def get_generator_duration(safetensors_path: str, video_duration: float | str = 5.0, seed: int = 0) -> int:
|
| 481 |
+
"""Kalkulasi alokasi waktu GPU ZeroGPU dinamis dan aman sesuai opsi durasi diskrit."""
|
| 482 |
try:
|
| 483 |
dur_val = float(str(video_duration).replace("s", "").strip())
|
| 484 |
except Exception:
|
| 485 |
dur_val = 5.0
|
| 486 |
+
return DURATION_GPU_MAP.get(dur_val, int(min(max(50, 25 + dur_val * 4.8), 105)))
|
| 487 |
|
| 488 |
def _load_base_workflow() -> dict[str, Any]:
|
| 489 |
with open(WORKFLOW_FILE, "r", encoding="utf-8") as f:
|