tsgpt / app.py
brichett's picture
Update app.py
9211fe0 verified
raw
history blame
538 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
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)