File size: 343 Bytes
0304edb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from fastapi import FastAPI
import gradio as gr

CUSTOM_PATH = "/"

app = FastAPI()


def request_formatter(text: str) -> str:
    return f"transformed {text}."


@app.get("/health")
def read_main():
    return {"message": "ok"}


io = gr.Interface(request_formatter, "textbox", "textbox")
app = gr.mount_gradio_app(app, io, path=CUSTOM_PATH)