Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
CUSTOM_PATH = "/gradio"
|
5 |
+
|
6 |
+
app = FastAPI()
|
7 |
+
|
8 |
+
|
9 |
+
@app.get("/")
|
10 |
+
def read_main():
|
11 |
+
return {"message": "This is your main app"}
|
12 |
+
|
13 |
+
|
14 |
+
io = gr.Interface(lambda x: "Hello, " + x + "!", "textbox", "textbox")
|
15 |
+
app = gr.mount_gradio_app(app, io, path=CUSTOM_PATH)
|