yatin-superintelligence commited on
Commit
0bd01ac
·
verified ·
1 Parent(s): 4655d6b

Upload server/app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. 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
- # Override OpenEnv's "/" redirect with our custom landing page.
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