import threading import uvicorn from app import main as gradio_main # Start Gradio app in the background threading.Thread(target=gradio_main).start() # Start FastAPI app (predict endpoint) if __name__ == "__main__": uvicorn.run("api:app", host="0.0.0.0", port=8000)