Ariel Gamino commited on
Commit
8e9c6d5
·
1 Parent(s): 2c6911c

Adding Hello app

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ # Define a simple "Hello World" function
4
+ def greet(name):
5
+ """Return html with name and an image"""
6
+ html = f"""Hello <b>{name}</b>
7
+ <br>
8
+ <img src = http://cdn.loc.gov/service/pnp/highsm/28100/28167r.jpg>
9
+ """
10
+ return html
11
+
12
+ with gr.Blocks() as demo:
13
+ name = gr.Textbox(label="Name")
14
+ output = gr.HTML(label="Output Box")
15
+ greet_btn = gr.Button("Greet")
16
+ greet_btn.click(fn=greet, inputs=name, outputs=output)
17
+
18
+ demo.launch()