Spaces:
Running on Zero
Running on Zero
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -134,7 +134,7 @@ def get_duration(input_image, prompt, temperature, top_p, max_new_tokens, log_pr
|
|
| 134 |
# Generation speed is ~40 tok/s on ZeroGPU; a full 512-token caption measured
|
| 135 |
# ~13s wall. Scale the GPU request with the token budget instead of the 60s
|
| 136 |
# default so anonymous visitors with small quotas aren't rejected up front.
|
| 137 |
-
return min(
|
| 138 |
|
| 139 |
|
| 140 |
@spaces.GPU(duration=get_duration)
|
|
|
|
| 134 |
# Generation speed is ~40 tok/s on ZeroGPU; a full 512-token caption measured
|
| 135 |
# ~13s wall. Scale the GPU request with the token budget instead of the 60s
|
| 136 |
# default so anonymous visitors with small quotas aren't rejected up front.
|
| 137 |
+
return min(60, 6 + int(max_new_tokens) // 40)
|
| 138 |
|
| 139 |
|
| 140 |
@spaces.GPU(duration=get_duration)
|