ssdfsdfa commited on
Commit
a3648b6
1 Parent(s): 862caa3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -21
app.py CHANGED
@@ -1,28 +1,8 @@
1
- # import gradio as gr
2
-
3
- # def greet(name):
4
- # return "Hello " + name + "!"
5
-
6
- # demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
-
8
- # demo.launch()
9
- from fastapi import FastAPI
10
  import gradio as gr
11
 
12
- CUSTOM_PATH = "/gradio/"
13
- # CUSTOM_PATH = ""
14
- app = FastAPI()
15
-
16
  def greet(name):
17
  return "Hello " + name + "!"
18
 
19
  demo = gr.Interface(fn=greet, inputs="text", outputs="text")
20
 
21
-
22
- @app.get("/")
23
- def read_main():
24
- return {"message": "This is your main app"}
25
-
26
-
27
- io = gr.Interface(lambda x: "Hellosssss, " + x + "!", "textbox", "textbox")
28
- app = gr.mount_gradio_app(app, io, path=CUSTOM_PATH)
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
 
 
 
 
3
  def greet(name):
4
  return "Hello " + name + "!"
5
 
6
  demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
 
8
+ demo.launch(root_path="/gradio")