masapasa commited on
Commit
edf41f7
1 Parent(s): b3dc435

Add application file

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