Spaces:
Sleeping
Sleeping
Deploy build-0d95f87
Browse files- backend/main.py +5 -5
backend/main.py
CHANGED
|
@@ -820,16 +820,16 @@ try:
|
|
| 820 |
import gradio as gr
|
| 821 |
from frontend.app import demo as gradio_demo # the gr.Blocks() object
|
| 822 |
|
| 823 |
-
# Mount Gradio at /ui; FastAPI routes take priority because they're
|
| 824 |
-
# registered first via @app.get / @app.post decorators.
|
| 825 |
-
app = gr.mount_gradio_app(app, gradio_demo, path="/ui")
|
| 826 |
-
logger.info("Gradio UI mounted at /ui — full app on single port.")
|
| 827 |
-
|
| 828 |
from fastapi.responses import RedirectResponse
|
| 829 |
@app.get("/")
|
| 830 |
def redirect_to_ui():
|
| 831 |
return RedirectResponse(url="/ui")
|
| 832 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 833 |
except Exception as _e:
|
| 834 |
logger.warning(f"Gradio mount skipped ({_e}). API-only mode active.")
|
| 835 |
|
|
|
|
| 820 |
import gradio as gr
|
| 821 |
from frontend.app import demo as gradio_demo # the gr.Blocks() object
|
| 822 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 823 |
from fastapi.responses import RedirectResponse
|
| 824 |
@app.get("/")
|
| 825 |
def redirect_to_ui():
|
| 826 |
return RedirectResponse(url="/ui")
|
| 827 |
|
| 828 |
+
# Mount Gradio at /ui; FastAPI routes take priority because they're
|
| 829 |
+
# registered first via @app.get / @app.post decorators.
|
| 830 |
+
app = gr.mount_gradio_app(app, gradio_demo, path="/ui")
|
| 831 |
+
logger.info("Gradio UI mounted at /ui — full app on single port.")
|
| 832 |
+
|
| 833 |
except Exception as _e:
|
| 834 |
logger.warning(f"Gradio mount skipped ({_e}). API-only mode active.")
|
| 835 |
|