demo2 / app.py
xahiru's picture
space tag
86839c2
Raw History Blame Contribute Delete
378 Bytes
import gradio as gr
import spaces
@spaces.GPU(duration=60)
def greet(name, intensity):
return "Hello, " + name + "!" * int(intensity)
with gr.Blocks() as demo:
name = gr.Textbox(label="Name")
intensity = gr.Slider(1, 10, value=2)
output = gr.Textbox()
btn = gr.Button("Submit")
btn.click(greet, inputs=[name, intensity], outputs=output)
demo.launch()