Rodrigo_Cobo commited on
Commit
cdcc96d
1 Parent(s): 77dd0d7

using blocks

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -1,13 +1,13 @@
1
  import gradio as gr
 
 
2
 
 
 
 
 
 
 
 
3
 
4
- def image_classifier(inp):
5
- return {'cat': 0.3, 'dog': 0.7}
6
-
7
- iface = gr.Interface(
8
- image_classifier,
9
- inputs="image",
10
- outputs="label",
11
- title="Hot Dog? Or Not?",
12
- )
13
- iface.launch()
 
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()