alibaybay commited on
Commit
2fe6cb6
·
verified ·
1 Parent(s): b812ed0

Fix: Increase generator dynamic timeout headroom (55s, 75s, 100s)

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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: 45, # Waktu riil ~35s -> Minta 45s (ZeroGPU reserve: 67.5s)
476
- 10.0: 65, # Waktu riil ~55s -> Minta 65s (ZeroGPU reserve: 97.5s)
477
- 15.0: 85, # Waktu riil ~74.6s -> Minta 85s (ZeroGPU reserve: 127.5s)
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 presisi 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(40, 20 + dur_val * 4.3), 90)))
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: