Skip to content

Instantly share code, notes, and snippets.

@sunilkumardash9
Created April 28, 2023 19:01
Show Gist options
  • Save sunilkumardash9/1d9ec63683723747c42bbffd3ffccb78 to your computer and use it in GitHub Desktop.
Save sunilkumardash9/1d9ec63683723747c42bbffd3ffccb78 to your computer and use it in GitHub Desktop.
import gradio as gr
def greet(name):
return"Hello " + name + "!"
with gr.Blocks() as demo:
name = gr.Textbox(label="Name")
output = gr.Textbox(label="Output Box")
greet_btn = gr.Button("Greet")
greet_btn.click(fn=greet, inputs=name, outputs=output, api_name="greet")
demo.launch()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment