Spaces:
Running
Running
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() | |