Spaces:
Running on Zero
Running on Zero
fix(spaces): _duration_for must accept progress kwarg to match _execute_workflow
Browse filesZeroGPU calls the duration estimator with the same args it'll pass to the
@spaces.GPU function. After adding progress as the 7th arg to
_execute_workflow in 27ffbbc, _duration_for raised TypeError on every
generation. Add progress to its signature; we ignore it for estimation.
- backend.py +5 -0
backend.py
CHANGED
|
@@ -99,9 +99,14 @@ def _duration_for(
|
|
| 99 |
mode: str,
|
| 100 |
preset: str,
|
| 101 |
multiplier: float = 1.0,
|
|
|
|
| 102 |
) -> int:
|
| 103 |
"""ZeroGPU duration estimator. Same signature as _execute_workflow.
|
| 104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
Estimate = (base × preset multiplier + cold-cache buffer + per-frame VAE
|
| 106 |
decode time) × retry multiplier, clamped to [60s, 900s]. The 900s ceiling
|
| 107 |
keeps a single failed call from torching the daily quota.
|
|
|
|
| 99 |
mode: str,
|
| 100 |
preset: str,
|
| 101 |
multiplier: float = 1.0,
|
| 102 |
+
progress: Any = None,
|
| 103 |
) -> int:
|
| 104 |
"""ZeroGPU duration estimator. Same signature as _execute_workflow.
|
| 105 |
|
| 106 |
+
`progress` is a gr.Progress instance forwarded by the caller; we ignore it
|
| 107 |
+
here (estimator doesn't emit progress) but must accept it positionally so
|
| 108 |
+
ZeroGPU can call us with the same arg list it'll use for _execute_workflow.
|
| 109 |
+
|
| 110 |
Estimate = (base × preset multiplier + cold-cache buffer + per-frame VAE
|
| 111 |
decode time) × retry multiplier, clamped to [60s, 900s]. The 900s ceiling
|
| 112 |
keeps a single failed call from torching the daily quota.
|