Spaces:
Running on Zero
Running on Zero
app.py: the startup warm-up catches CUDA and ZeroGPU errors only
Browse files
app.py
CHANGED
|
@@ -406,7 +406,7 @@ with gr.Blocks(title="Swedish HTR: TrOCR, MiniCPM-OCR and DSpark") as demo:
|
|
| 406 |
if os.environ.get("SPACES_ZERO_GPU"):
|
| 407 |
try:
|
| 408 |
_warm_startup()
|
| 409 |
-
except
|
| 410 |
print(f"startup warm-up skipped: {error}", flush=True)
|
| 411 |
|
| 412 |
demo.queue(default_concurrency_limit=2).launch(show_error=True)
|
|
|
|
| 406 |
if os.environ.get("SPACES_ZERO_GPU"):
|
| 407 |
try:
|
| 408 |
_warm_startup()
|
| 409 |
+
except (RuntimeError, gr.Error) as error: # CUDA or ZeroGPU: the first request then warms its own worker
|
| 410 |
print(f"startup warm-up skipped: {error}", flush=True)
|
| 411 |
|
| 412 |
demo.queue(default_concurrency_limit=2).launch(show_error=True)
|