Zrelv Claude Opus 4.8 (1M context) commited on
Commit ·
d0326d0
1
Parent(s): 465e9b6
Cap GPU duration reservation at 140s to clear free-tier per-call limit
Browse filesget_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
app.py
CHANGED
|
@@ -373,7 +373,11 @@ def get_inference_duration(
|
|
| 373 |
inter_time = (total_out_frames * 0.02)
|
| 374 |
gen_time += inter_time
|
| 375 |
|
| 376 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 377 |
|
| 378 |
|
| 379 |
@spaces.GPU(duration=get_inference_duration)
|
|
|
|
| 373 |
inter_time = (total_out_frames * 0.02)
|
| 374 |
gen_time += inter_time
|
| 375 |
|
| 376 |
+
# Cap reserved GPU duration so the reported reservation stays under free-tier
|
| 377 |
+
# ZeroGPU's ~300s per-call limit — the padded worst-case was tripping
|
| 378 |
+
# "requested GPU duration larger than the maximum allowed". 140 still covers
|
| 379 |
+
# real p90 (~107s) and the 150s caller timeout.
|
| 380 |
+
return min(15 + gen_time, 140)
|
| 381 |
|
| 382 |
|
| 383 |
@spaces.GPU(duration=get_inference_duration)
|