joshuarauh commited on
Commit
8de0ae8
·
verified ·
1 Parent(s): 69b437a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -1306,15 +1306,18 @@ Remember to write out the complete solution even if you are repeating things fro
1306
 
1307
  # Add this function to update subtopic choices
1308
  def update_subtopics(subject):
 
1309
  if subject in SUBJECT_SUBTOPICS:
1310
- return {
1311
- "choices": SUBJECT_SUBTOPICS[subject],
1312
- "visible": True
1313
- }
1314
- return {
1315
- "choices": [],
1316
- "visible": False
1317
- }
 
 
1318
 
1319
  # Create Gradio interface
1320
  with gr.Blocks() as interface:
 
1306
 
1307
  # Add this function to update subtopic choices
1308
  def update_subtopics(subject):
1309
+ logger.debug(f"update_subtopics called with subject: {subject}")
1310
  if subject in SUBJECT_SUBTOPICS:
1311
+ logger.debug(f"Found subtopics: {SUBJECT_SUBTOPICS[subject]}")
1312
+ return gr.Dropdown.update(
1313
+ choices=SUBJECT_SUBTOPICS[subject],
1314
+ visible=True
1315
+ )
1316
+ logger.debug("No subtopics found for subject")
1317
+ return gr.Dropdown.update(
1318
+ choices=[],
1319
+ visible=False
1320
+ )
1321
 
1322
  # Create Gradio interface
1323
  with gr.Blocks() as interface: