Small feedback :)

#1
by merve HF staff - opened
scikit-learn org

Hello @rashmi ๐Ÿ‘‹ thanks a lot for this demo! I feel like it would be better to have an event listener here instead of the button click, as there's single slider, you can do so by removing button and calling slider.change()and also have the plot right next to slider to save more Space. WDYT? See an example use of event listeners on second code block here:

import gradio as gr

def welcome(name):
    return f"Welcome to Gradio, {name}!"

with gr.Blocks() as demo:
    gr.Markdown(
    """
    # Hello World!
    Start typing below to see the output.
    """)
    inp = gr.Textbox(placeholder="What is your name?")
    out = gr.Textbox()
    inp.change(welcome, inp, out)

demo.launch() 
scikit-learn org

Thank you for the feedback @merve
I added slider.change()and also have the plot right next to slider. Let me know if this seems ok or if you have any other feedback

Sign up or log in to comment