File size: 482 Bytes
2322418 6635f2f 2322418 6635f2f 2322418 6635f2f caa5196 2322418 2b7fd2d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | import gradio as gr
from fastapi import FastAPI
def echo(message):
return message
app = FastAPI()
@app.get("/hello")
async def hello():
return {"message": "Hello, World!"}
demo = gr.Interface(
fn=echo,
inputs="text",
outputs="text",
title="Echo App",
description="Enter some text, and I'll echo it back to you!"
)
gr.mount_gradio_app(app, demo, path="/")
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=7860) |