from fastapi import FastAPI | |
import gradio as gr | |
CUSTOM_PATH = "/gradio" | |
app = FastAPI() | |
def read_main(): | |
return {"message": "This is your main app"} | |
io = gr.Interface(lambda x: "Hello, " + x + "!", "textbox", "textbox") | |
app = gr.mount_gradio_app(app, io, path=CUSTOM_PATH) | |
def greet(name): | |
return "Hello " + name + "!!" | |
iface = gr.Interface(fn=greet, inputs="text", outputs="text") | |
iface.launch() | |