Fix Gradio dashboard hang: restore module-level mounting (required for queue/WebSocket)
Browse files- server/app.py +7 -11
server/app.py
CHANGED
|
@@ -378,17 +378,13 @@ def build_custom_ui():
|
|
| 378 |
|
| 379 |
return demo
|
| 380 |
|
| 381 |
-
#
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
gr.mount_gradio_app(app, custom_demo, path="/dashboard/")
|
| 389 |
-
print("[INFO] PolicyEvolver Dashboard mounted at /dashboard/")
|
| 390 |
-
except Exception as e:
|
| 391 |
-
print(f"[WARNING] Failed to mount Gradio Dashboard: {e}")
|
| 392 |
|
| 393 |
def main():
|
| 394 |
# Sync with Hugging Face and local requirements
|
|
|
|
| 378 |
|
| 379 |
return demo
|
| 380 |
|
| 381 |
+
# Mount Gradio at module level (required for Gradio queue/WebSocket to work)
|
| 382 |
+
try:
|
| 383 |
+
custom_demo = build_custom_ui()
|
| 384 |
+
app = gr.mount_gradio_app(app, custom_demo, path="/dashboard/")
|
| 385 |
+
print("[INFO] PolicyEvolver Dashboard mounted at /dashboard/")
|
| 386 |
+
except Exception as e:
|
| 387 |
+
print(f"[WARNING] Failed to mount Gradio Dashboard: {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 388 |
|
| 389 |
def main():
|
| 390 |
# Sync with Hugging Face and local requirements
|