File size: 321 Bytes
78ec26d
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import gradio as gr

def greet(name):
    return f"Hello, {name}!"

with gr.Blocks() as demo:
    name_input = gr.Textbox(label="Enter your name")
    greet_button = gr.Button("Greet")
    output_text = gr.Textbox(label="Greeting")

    greet_button.click(fn=greet, inputs=name_input, outputs=output_text)

demo.launch()