mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-15 02:11:15 +08:00
17 lines
360 B
Python
17 lines
360 B
Python
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() |