brichett commited on
Commit
c7fdde9
·
verified ·
1 Parent(s): 2ff1cf7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -4,8 +4,15 @@ import sys
4
  # Adjust PYTHONPATH
5
  sys.path.append(os.path.join(os.path.dirname(__file__), 'src'))
6
 
7
- from src.gradio_server import iface_combined
8
 
9
- # Launch the Gradio interface defined in gradio_server.py
10
- if __name__ == "__main__":
11
- iface_combined.launch(server_name="0.0.0.0", server_port=7861)
 
 
 
 
 
 
 
 
4
  # Adjust PYTHONPATH
5
  sys.path.append(os.path.join(os.path.dirname(__file__), 'src'))
6
 
7
+ from src.gradio_server import app, iface_combined
8
 
9
+ # Function to run FastAPI in a separate thread
10
+ def run_fastapi():
11
+ uvicorn.run(app, host="0.0.0.0", port=8000)
12
+
13
+ # Start the FastAPI server in a separate thread
14
+ fastapi_thread = threading.Thread(target=run_fastapi)
15
+ fastapi_thread.start()
16
+
17
+ # Launch the Gradio interface
18
+ iface_combined.launch(server_name="0.0.0.0", server_port=7861)