gradio/demo/hello_world_2/run.py
Ari Roffe 0dccf825c4
Add step parameter to slider (#7399)
* Add step parameter to slider

* fix demos

* changes

* tweaks to demo

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-02-12 10:06:46 -08:00

14 lines
304 B
Python

import gradio as gr
def greet(name, intensity):
return "Hello, " + name + "!" * intensity
demo = gr.Interface(
fn=greet,
inputs=["text", gr.Slider(value=2, minimum=1, maximum=10, step=1)],
outputs=[gr.Textbox(label="greeting", lines=3)],
)
if __name__ == "__main__":
demo.launch()