Spaces:
Running on Zero
Running on Zero
Size the reservation from current timings
Browse filesThe estimate was measured when the model was built inside every call. It is built when the worker starts now, and a call measures about 2 to 8 s for 30 s of piano and 10 to 15 s for 300 s, so the reservation is 8 s plus 0.05 s per second of audio, down from 10 s plus 0.1 s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -67,8 +67,9 @@ MAX_GPU_SECONDS = 900
|
|
| 67 |
|
| 68 |
|
| 69 |
def gpu_seconds(input_file):
|
| 70 |
-
# Measured at about
|
| 71 |
-
|
|
|
|
| 72 |
|
| 73 |
|
| 74 |
@spaces.GPU(duration=gpu_seconds)
|
|
|
|
| 67 |
|
| 68 |
|
| 69 |
def gpu_seconds(input_file):
|
| 70 |
+
# Measured at about 2 to 8 s for 30 s of piano and 10 to 15 s for 300 s, upload included,
|
| 71 |
+
# padded. The model is built when the worker starts, not inside the call.
|
| 72 |
+
return 8 + 0.05 * sf.info(input_file).duration
|
| 73 |
|
| 74 |
|
| 75 |
@spaces.GPU(duration=gpu_seconds)
|