fix: Resolve HF Container Error by moving dashboard to /dashboard/ and restoring root redirect
Browse files- server/app.py +5 -1
server/app.py
CHANGED
|
@@ -38,6 +38,10 @@ async def global_exception_handler(request: Request, exc: Exception):
|
|
| 38 |
content={"detail": "Internal Error", "message": str(exc), "traceback": traceback.format_exc()},
|
| 39 |
)
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 42 |
# Custom Professional "Judge Ready" Gradio Dashboard
|
| 43 |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -221,7 +225,7 @@ def build_custom_ui():
|
|
| 221 |
|
| 222 |
if os.getenv("ENABLE_WEB_INTERFACE", "false").lower() == "true":
|
| 223 |
custom_demo = build_custom_ui()
|
| 224 |
-
app = gr.mount_gradio_app(app, custom_demo, path="/")
|
| 225 |
|
| 226 |
def main():
|
| 227 |
uvicorn.run("server.app:app", host="0.0.0.0", port=8000, reload=False)
|
|
|
|
| 38 |
content={"detail": "Internal Error", "message": str(exc), "traceback": traceback.format_exc()},
|
| 39 |
)
|
| 40 |
|
| 41 |
+
@app.get("/")
|
| 42 |
+
async def root():
|
| 43 |
+
return RedirectResponse(url="/dashboard/")
|
| 44 |
+
|
| 45 |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 46 |
# Custom Professional "Judge Ready" Gradio Dashboard
|
| 47 |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 225 |
|
| 226 |
if os.getenv("ENABLE_WEB_INTERFACE", "false").lower() == "true":
|
| 227 |
custom_demo = build_custom_ui()
|
| 228 |
+
app = gr.mount_gradio_app(app, custom_demo, path="/dashboard/")
|
| 229 |
|
| 230 |
def main():
|
| 231 |
uvicorn.run("server.app:app", host="0.0.0.0", port=8000, reload=False)
|