tsgpt / app.py
brichett's picture
Update app.py
c7fdde9 verified
raw
history blame
492 Bytes
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)