New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: type object 'Dropdown' has no attribute 'update' #6862
Comments
These don't work either. However, the label gets updated correctly. return gr.update(label="New Symbols", choices=['A','B']) return gr.Dropdown(label="New Symbols", choices=['A','B']) |
Hi @gautamsabba there are two issues here:
This is a working version of your app: import gradio as gr
categories = ['Long-Short Equity', 'Long Government', 'Multisector Bond', 'Emerging Markets Bond', 'Corporate Bond', 'Intermediate Government', 'Inflation-Protected Bond', 'Intermediate-Term Bond', 'Muni National Long', 'Unknown', 'High Yield Muni', 'Long-Term Bond', 'Muni California Long', 'Muni National Interm', 'Nontraditional Bond', 'World Bond', 'Short Government', 'Muni National Short', 'Short-Term Bond', 'Preferred Stock', 'Ultrashort Bond', 'High Yield Bond', 'Muni New York Long', 'Emerging-Markets Local-Currency Bond', 'Miscellaneous Region', 'Bank Loan', 'Commodities Broad Basket', 'Japan Stock', 'World Allocation', 'Tactical Allocation', 'Large Value', 'Foreign Large Growth', 'Energy Limited Partnership', 'Foreign Small/Mid Blend', 'Foreign Large Value', 'Foreign Large Blend', 'Europe Stock', 'Allocation--50% to 70% Equity', 'Financial', 'Diversified Emerging Mkts', 'Industrials', 'Mid-Cap Blend', 'Large Growth', 'Communications', 'Diversified Pacific/Asia', 'Foreign Small/Mid Value', 'Convertibles', 'Small Value', 'Latin America Stock', 'Equity Energy', 'Natural Resources', 'Real Estate', 'Large Blend', 'Small Blend', 'Consumer Cyclical']
def update_symbols(category):
symbols = ['FFIU', 'IGEB', 'VCIT', 'FCOR', 'SKOR', 'KORP', 'LQDI']
return gr.Dropdown(choices=symbols, interactive=True)
# Create the Gradio interface
with gr.Blocks() as demo:
gr.Markdown("### Dropdown Tester")
with gr.Row():
category_dropdown = gr.Dropdown(choices=categories, label="Category")
symbol_dropdown = gr.Dropdown(label="Symbols", choices=[])
# Update the symbols dropdown when the category changes
category_dropdown.change(update_symbols, inputs=[category_dropdown], outputs=[symbol_dropdown])
demo.launch() |
Thank you. |
when i remove the options from the first drop down iam getting undefined for the options i selected in the dropdown_2 instead of giving me an empty drop_down please tell me how to remove this bug @abidlabs |
Describe the bug
Looks like update() on components is broken in 4.11.0
Have you searched existing issues? 馃攷
Reproduction
System Info
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered: