qlemesle commited on
Commit
3156450
·
1 Parent(s): 5f96335
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -1,8 +1,16 @@
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
- demo.launch()
 
 
 
 
 
 
 
8
 
 
 
1
  import gradio as gr
2
 
3
+ def welcome(name):
4
+ return f"Welcome to Gradio, {name}!"
5
 
6
+ with gr.Blocks() as demo:
7
+ gr.Markdown(
8
+ """
9
+ # Hello World!
10
+ Start typing below to see the output.
11
+ """)
12
+ inp = gr.Textbox(placeholder="What is your name?")
13
+ out = gr.Textbox()
14
+ inp.change(welcome, inp, out)
15
 
16
+ demo.launch()