| import gradio as gr | |
| from fastapi import FastAPI | |
| import uvicorn | |
| app = FastAPI() | |
| with gr.Blocks(fill_height=True) as demo: | |
| text = gr.Textbox(); | |
| def test(): | |
| return {"test": True} | |
| GradioApp = gr.mount_gradio_app(app, demo, path=""); | |
| uvicorn.run(GradioApp, port=7860, host="0.0.0.0") | |