File size: 492 Bytes
d4a97f5 c7fdde9 2dc3529 c7fdde9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
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
# 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 = threading.Thread(target=run_fastapi)
fastapi_thread.start()
# Launch the Gradio interface
iface_combined.launch(server_name="0.0.0.0", server_port=7861)
|