import gradio as gr | |
def welcome(name): | |
return f"Welcome to Gradio, {name}!" | |
with gr.Blocks() as demo: | |
gr.Markdown( | |
""" | |
# Hello World! | |
Start typing below to see the output. | |
""") | |
inp = gr.Textbox(placeholder="What is your name?") | |
out = gr.Textbox() | |
inp.change(welcome, inp, out) | |
if __name__ == "__main__": | |
demo.launch() | |