Spaces:
Sleeping
Sleeping
Commit ·
3af94fa
1
Parent(s): 52e9e29
fix: replace silent suppress with logged warning for Gradio mount failure
Browse files- server/app.py +4 -2
server/app.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
from __future__ import annotations
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
from fastapi import HTTPException
|
| 8 |
from fastapi.responses import JSONResponse
|
|
@@ -52,10 +52,12 @@ app = create_app(
|
|
| 52 |
max_concurrent_envs=8,
|
| 53 |
)
|
| 54 |
|
| 55 |
-
|
| 56 |
import gradio as gr
|
| 57 |
|
| 58 |
app = gr.mount_gradio_app(app, build_demo(), path="/demo")
|
|
|
|
|
|
|
| 59 |
|
| 60 |
|
| 61 |
@app.get("/")
|
|
|
|
| 2 |
|
| 3 |
from __future__ import annotations
|
| 4 |
|
| 5 |
+
import logging
|
| 6 |
|
| 7 |
from fastapi import HTTPException
|
| 8 |
from fastapi.responses import JSONResponse
|
|
|
|
| 52 |
max_concurrent_envs=8,
|
| 53 |
)
|
| 54 |
|
| 55 |
+
try:
|
| 56 |
import gradio as gr
|
| 57 |
|
| 58 |
app = gr.mount_gradio_app(app, build_demo(), path="/demo")
|
| 59 |
+
except Exception:
|
| 60 |
+
logging.getLogger(__name__).warning("Gradio demo unavailable", exc_info=True)
|
| 61 |
|
| 62 |
|
| 63 |
@app.get("/")
|