bep40 commited on
Commit
1b50cca
·
verified ·
1 Parent(s): 8fc463d

Try Gradio mounting

Browse files
Files changed (1) hide show
  1. gradio_app.py +14 -0
gradio_app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import sys
3
+ sys.path.insert(0, '/app')
4
+ from app_v2_entry import app as fastapi_app
5
+
6
+ # Mount FastAPI under Gradio
7
+ demo = gr.mount_gradio_app(
8
+ fastapi_app,
9
+ path="/api",
10
+ show_error=True
11
+ )
12
+
13
+ if __name__ == "__main__":
14
+ demo.launch(server_port=7860)