Upload server/app.py with huggingface_hub
Browse files- server/app.py +3 -2
server/app.py
CHANGED
|
@@ -52,9 +52,10 @@ app = create_app(
|
|
| 52 |
max_concurrent_envs=1, # increase this number to allow more concurrent WebSocket sessions
|
| 53 |
)
|
| 54 |
|
|
|
|
|
|
|
| 55 |
|
| 56 |
-
#
|
| 57 |
-
# The Gradio playground remains at /web/
|
| 58 |
@app.get("/", include_in_schema=False)
|
| 59 |
async def root():
|
| 60 |
from fastapi.responses import HTMLResponse
|
|
|
|
| 52 |
max_concurrent_envs=1, # increase this number to allow more concurrent WebSocket sessions
|
| 53 |
)
|
| 54 |
|
| 55 |
+
# Remove OpenEnv's default "/" redirect so our custom landing page takes priority
|
| 56 |
+
app.routes[:] = [r for r in app.routes if not (hasattr(r, 'path') and r.path == '/' and hasattr(r, 'methods') and 'GET' in r.methods)]
|
| 57 |
|
| 58 |
+
# Custom landing page at / — Gradio playground stays at /web/
|
|
|
|
| 59 |
@app.get("/", include_in_schema=False)
|
| 60 |
async def root():
|
| 61 |
from fastapi.responses import HTMLResponse
|