File size: 437 Bytes
1f9b118
 
b975982
1f9b118
 
 
 
 
 
 
 
 
 
 
 
b604603
bd6d142
b604603
bd6d142
b604603
bd6d142
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from fastapi import FastAPI
import gradio as gr
import uvicorn

CUSTOM_PATH = "/gradio"

app = FastAPI()


@app.get("/")
def read_main():
    return {"message": "This is your main app"}


io = gr.Interface(lambda x: "Hello, " + x + "!", "textbox", "textbox")

#gradio_app = gr.routes.App.create_app(io)

#app.mount(CUSTOM_PATH, gradio_app)

app = gr.mount_gradio_app(app, io, path=CUSTOM_PATH)
uvicorn.run(app, host="0.0.0.0", port=7860)