How to dynamically change the choices of a dropdown? what am I doing wrong?
I want to create a gradio webui that shows 2 dropdown, ‘rs_hw’ changes dynamically according to the ‘rs’ value. what am i doing wrong here?import gradio as gr

languages = ['spanish', 'english'] 
homeworks = {'spanish': ['hola', 'bien', 'gracias'], 'english': ['hello', 'good', 'thank you']}

def rs_change(rs):
    return homeworks[rs]

with gr.Blocks() as app:

    rs = gr.Dropdown(choices=languages)
    rs_hw = gr.Dropdown()

    rs.change(fn=rs_change, inputs=[rs], outputs=[rs_hw])

    app.launch()rs_hwkeeps always empty
2023-07-19T13:31:38Z
hi@carlositselfHere’s how you update it based on the changesimport gradio as gr

languages = ['spanish', 'english'] 
homeworks = {'spanish': ['hola', 'bien', 'gracias'], 'english': ['hello', 'good', 'thank you']}

def rs_change(rs):
    return gr.update(choices=homeworks[rs], value=None)

with gr.Blocks() as app:

    rs = gr.Dropdown(choices=languages, value='english')
    rs_hw = gr.Dropdown(choices=homeworks['english'], interactive=True)

    rs.change(fn=rs_change, inputs=[rs], outputs=[rs_hw])

app.launch()