Noperi commited on
Commit
a83cc8e
·
1 Parent(s): fb9d7f2

Mount Gradio at /gradio to not interfere with FastAPI routes

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -17,13 +17,13 @@ def health():
17
  @app.get("/download_tg")
18
  @spaces.GPU
19
  async def download_telegram_file(file_id: str, bot_token: str, chat_id: str = None, repo: str = None, pat: str = None):
20
- return {"status": "success", "file_id": file_id, "download_url": "https://github.com"}
21
 
22
  def health_ui():
23
  return "GitCloud Bridge Online"
24
 
25
  demo = gr.Interface(fn=health_ui, inputs=[], outputs="text")
26
- app = gr.mount_gradio_app(app, demo, path="/")
27
 
28
  if __name__ == "__main__":
29
  uvicorn.run(app, host="0.0.0.0", port=7860)
 
17
  @app.get("/download_tg")
18
  @spaces.GPU
19
  async def download_telegram_file(file_id: str, bot_token: str, chat_id: str = None, repo: str = None, pat: str = None):
20
+ return {"status": "success", "file_id": file_id, "message": "Bridge endpoint working"}
21
 
22
  def health_ui():
23
  return "GitCloud Bridge Online"
24
 
25
  demo = gr.Interface(fn=health_ui, inputs=[], outputs="text")
26
+ app = gr.mount_gradio_app(app, demo, path="/gradio")
27
 
28
  if __name__ == "__main__":
29
  uvicorn.run(app, host="0.0.0.0", port=7860)