mitudrudutta commited on
Commit
3af94fa
·
1 Parent(s): 52e9e29

fix: replace silent suppress with logged warning for Gradio mount failure

Browse files
Files changed (1) hide show
  1. server/app.py +4 -2
server/app.py CHANGED
@@ -2,7 +2,7 @@
2
 
3
  from __future__ import annotations
4
 
5
- from contextlib import suppress
6
 
7
  from fastapi import HTTPException
8
  from fastapi.responses import JSONResponse
@@ -52,10 +52,12 @@ app = create_app(
52
  max_concurrent_envs=8,
53
  )
54
 
55
- with suppress(Exception):
56
  import gradio as gr
57
 
58
  app = gr.mount_gradio_app(app, build_demo(), path="/demo")
 
 
59
 
60
 
61
  @app.get("/")
 
2
 
3
  from __future__ import annotations
4
 
5
+ import logging
6
 
7
  from fastapi import HTTPException
8
  from fastapi.responses import JSONResponse
 
52
  max_concurrent_envs=8,
53
  )
54
 
55
+ try:
56
  import gradio as gr
57
 
58
  app = gr.mount_gradio_app(app, build_demo(), path="/demo")
59
+ except Exception:
60
+ logging.getLogger(__name__).warning("Gradio demo unavailable", exc_info=True)
61
 
62
 
63
  @app.get("/")