Spaces:
Running on Zero
Running on Zero
File size: 378 Bytes
48f8de2 86839c2 48f8de2 86839c2 48f8de2 86839c2 48f8de2 86839c2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 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() |