Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -78,7 +78,7 @@ with gr.Blocks() as chat_interface:
|
|
78 |
def update_subcategories(selected_main_category):
|
79 |
"""Update the subcategory dropdown based on the main category."""
|
80 |
new_subcategories = categories.get(selected_main_category, [])
|
81 |
-
return gr.
|
82 |
|
83 |
# Handle main category change to update subcategories
|
84 |
main_category.change(update_subcategories, inputs=main_category, outputs=sub_category)
|
|
|
78 |
def update_subcategories(selected_main_category):
|
79 |
"""Update the subcategory dropdown based on the main category."""
|
80 |
new_subcategories = categories.get(selected_main_category, [])
|
81 |
+
return gr.update(choices=new_subcategories, value=new_subcategories[0] if new_subcategories else None)
|
82 |
|
83 |
# Handle main category change to update subcategories
|
84 |
main_category.change(update_subcategories, inputs=main_category, outputs=sub_category)
|