Spaces:
Running on Zero
Running on Zero
Shorten GPU reservations for single-crop inference
Browse filesReserve 30 seconds per model call instead of 90. All weights are preloaded and each call handles one bounded crop. The live pipeline ran all six models successfully on the first candidate, then unnecessarily rejected remaining short calls because the 135-second quota reservation exceeded the account balance. Keep explicit timeout/error handling and free ZeroGPU hardware unchanged.
app.py
CHANGED
|
@@ -349,7 +349,8 @@ def load_model(kind):
|
|
| 349 |
|
| 350 |
|
| 351 |
def gpu_call(fn):
|
| 352 |
-
|
|
|
|
| 353 |
|
| 354 |
|
| 355 |
@gpu_call
|
|
|
|
| 349 |
|
| 350 |
|
| 351 |
def gpu_call(fn):
|
| 352 |
+
# One bounded crop per call; weights are preloaded. Avoid reserving 90s for short inference.
|
| 353 |
+
return spaces.GPU(duration=30)(fn) if DEVICE == "cuda" else fn
|
| 354 |
|
| 355 |
|
| 356 |
@gpu_call
|