radames's picture
Update app.py
0b40cdf
raw
history blame contribute delete
519 Bytes
import gradio as gr
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
import uvicorn
app = FastAPI()
block = gr.Blocks().queue()
with block:
prompt = gr.Text()
output = gr.Text()
btn = gr.Button("Generate")
btn.click(lambda x:x, inputs=[prompt], outputs=[output])
app.mount("/static", StaticFiles(directory="static", html=True), name="static")
app = gr.mount_gradio_app(app, block, "/", gradio_api_url="http://localhost:7860/")
uvicorn.run(app, host="0.0.0.0", port=7860)