Zrelv Claude Opus 4.8 (1M context) commited on
Commit
17a0663
·
1 Parent(s): 28caa84

Cap GPU duration reservation at 140s to clear free-tier per-call limit

Browse files

get_inference_duration() returned a padded worst-case that, once reserved,
exceeded free-tier ZeroGPU's ~300s per-call cap -> 'The requested GPU duration
is larger than the maximum allowed'. Cap the reservation at 140s, which still
covers real p90 (~107s) and the 150s caller timeout, so generations run at any
length.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M4Dr1cMq3pUbTUnXXRs9V1

Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -441,6 +441,11 @@ def get_inference_duration(
441
  if safe_mode:
442
  total_time = total_time * 1.30
443
 
 
 
 
 
 
444
  return total_time
445
 
446
 
 
441
  if safe_mode:
442
  total_time = total_time * 1.30
443
 
444
+ # Cap reserved GPU duration so the reported reservation (×2 for xlarge) stays
445
+ # under free-tier ZeroGPU's ~300s per-call limit — the padded worst-case was
446
+ # tripping "requested GPU duration larger than the maximum allowed". 140 →
447
+ # ~280s reported, still covers real p90 (~107s) and the 150s caller timeout.
448
+ total_time = min(total_time, 140)
449
  return total_time
450
 
451