ScaziPWNZ commited on
Commit
8914580
·
verified ·
1 Parent(s): 73db814

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -1,11 +1,16 @@
1
- import gradio as gr
2
-
3
 
 
 
 
4
 
5
- def greet(name):
6
- return "Hello " + name + "!!"
7
 
 
8
 
 
 
 
9
 
10
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
11
- demo.launch()
 
1
+ from gradio_client import Client
 
2
 
3
+ client = Client("abidlabs/my-private-space", hf_token="...")
4
+ from fastapi import FastAPI
5
+ import gradio as gr
6
 
7
+ CUSTOM_PATH = "/gradio"
 
8
 
9
+ app = FastAPI()
10
 
11
+ @app.get("/")
12
+ def read_main():
13
+ return {"message": "This is your main app"}
14
 
15
+ io = gr.Interface(lambda x: "Hello, " + x + "!", "textbox", "textbox")
16
+ app = gr.mount_gradio_app(app, io, path=CUSTOM_PATH)