test_host_Gradio / interface_demo.py
manhhung211's picture
Upload app.py
d62c15b verified
Raw
History Blame Contribute Delete
538 Bytes
import gradio as gr
def great(name:str, times: float)-> str:
return f"Hello {name}! " * int(times)
with gr.Blocks(title = "App") as demo:
gr.Markdown('# Greeting App')
with gr.Row():
name = gr.Textbox(label="Name", placeholder="Enter your name here")
times = gr.Number(label="Times", value=1)
with gr.Row():
btn = gr.Button("Greet")
out = gr.Textbox(label="Output", interactive=False)
btn.click(great, inputs=[name, times], outputs = out)
demo.launch()