Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
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:
|