mukesh8252 commited on
Commit
77cbcd0
·
1 Parent(s): 5dff6da

Fix ZeroGPU quota duration ceiling

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -149,8 +149,12 @@ print("[startup] pipeline ready. HeartMuLa/HeartCodec weights load on first gene
149
 
150
  # ---------------------------------------------------------------- GPU function
151
  def _allocation_duration(lyrics: str, tags: str, duration_sec: float) -> int:
152
- """Declared ZeroGPU runtime ceiling (quota is billed on actual runtime)."""
153
- return 120 + int(duration_sec) * 2
 
 
 
 
154
 
155
 
156
  @spaces.GPU(duration=_allocation_duration)
 
149
 
150
  # ---------------------------------------------------------------- GPU function
151
  def _allocation_duration(lyrics: str, tags: str, duration_sec: float) -> int:
152
+ """Declared ZeroGPU runtime ceiling (quota is billed on actual runtime).
153
+
154
+ Cap at 295s: a free account with exactly 300s left rejects requests of
155
+ 300s (e.g. duration_sec=90 -> 120 + 90*2 = 300).
156
+ """
157
+ return min(295, 120 + int(duration_sec) * 2)
158
 
159
 
160
  @spaces.GPU(duration=_allocation_duration)