RamshaAnwar's picture
fix(hf): mount fastapi into gradio instead of running uvicorn manually
b7bda5c
Raw History Blame Contribute Delete
356 Bytes
import gradio as gr
from app.main import app as fastapi_app
# Create a dummy UI so Gradio has something to launch
demo = gr.Interface(
fn=lambda x: "ContextQuery API is running",
inputs="text",
outputs="text",
title="ContextQuery AI Backend"
)
# Mount the FastAPI app directly onto the Gradio app's server
demo.app.mount("/", fastapi_app)