mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-15 02:11:15 +08:00
0dccf825c4
* Add step parameter to slider * fix demos * changes * tweaks to demo --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
14 lines
304 B
Python
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()
|