File size: 500 Bytes
8e9c6d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr

# Define a simple "Hello World" function
def greet(name):
    """Return html with name and an image"""
    html = f"""Hello <b>{name}</b>

    <br>    

    <img src = http://cdn.loc.gov/service/pnp/highsm/28100/28167r.jpg>

    """
    return html
    
with gr.Blocks() as demo:
    name = gr.Textbox(label="Name")
    output = gr.HTML(label="Output Box")
    greet_btn = gr.Button("Greet")
    greet_btn.click(fn=greet, inputs=name, outputs=output)

demo.launch()