File size: 538 Bytes
d4a97f5
 
 
 
 
 
c7fdde9
0833ce0
 
2dc3529
c7fdde9
 
 
 
 
0833ce0
c7fdde9
 
 
9211fe0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os
import sys

# Adjust PYTHONPATH
sys.path.append(os.path.join(os.path.dirname(__file__), 'src'))

from src.gradio_server import app, iface_combined
import uvicorn
from threading import Thread

# Function to run FastAPI in a separate thread
def run_fastapi():
    uvicorn.run(app, host="0.0.0.0", port=8000)

# Start the FastAPI server in a separate thread
fastapi_thread = Thread(target=run_fastapi)
fastapi_thread.start()

# Launch the Gradio interface
iface_combined.launch(server_name="0.0.0.0", server_port=7861, share=True)