mirror of
https://github.com/gradio-app/gradio.git
synced 2025-03-13 11:57:29 +08:00
22 lines
388 B
Python
22 lines
388 B
Python
import gradio as gr
|
|
|
|
|
|
def update(name):
|
|
return f"Welcome to Gradio, {name}!"
|
|
|
|
demo = gr.Blocks()
|
|
|
|
with 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(fn=update,
|
|
inputs=inp,
|
|
outputs=out)
|
|
|
|
demo.launch() |