rwheel commited on
Commit
587bf4b
1 Parent(s): e9ff225

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -14
app.py CHANGED
@@ -1,15 +1,13 @@
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)
 
 
1
  import gradio as gr
2
+ def update(name):
3
+ return f"Welcome to Gradio, {name}!"
4
+
5
+ with gr.Blocks() as demo:
6
+ gr.Markdown("Start typing below and then click **Run** to see the output.")
7
+ with gr.Row():
8
+ inp = gr.Textbox(placeholder="What is your name?")
9
+ out = gr.Textbox()
10
+ btn = gr.Button("Run")
11
+ btn.click(fn=update, inputs=inp, outputs=out)
12
+
13
+ demo.launch(auth=("admin", "1234"))