Upload folder using huggingface_hub
Browse files- ankigen_core/ui_logic.py +19 -26
ankigen_core/ui_logic.py
CHANGED
@@ -23,32 +23,25 @@ def update_mode_visibility(
|
|
23 |
text_val = current_text if is_text else ""
|
24 |
url_val = current_url if is_web else ""
|
25 |
|
26 |
-
# Return a
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
"output_dataframe": gr.update(value=None),
|
46 |
-
"subjects_dataframe": gr.update(value=None),
|
47 |
-
"learning_order_markdown": gr.update(value=""),
|
48 |
-
"projects_markdown": gr.update(value=""),
|
49 |
-
"progress_html": gr.update(value="", visible=False),
|
50 |
-
"total_cards_number": gr.update(value=0, visible=False),
|
51 |
-
}
|
52 |
|
53 |
|
54 |
def use_selected_subjects(subjects_df: pd.DataFrame | None):
|
|
|
23 |
text_val = current_text if is_text else ""
|
24 |
url_val = current_url if is_web else ""
|
25 |
|
26 |
+
# Return a tuple of gr.update() calls in the order expected by app.py
|
27 |
+
return (
|
28 |
+
gr.update(visible=is_subject),
|
29 |
+
gr.update(visible=is_path),
|
30 |
+
gr.update(visible=is_text),
|
31 |
+
gr.update(visible=is_web),
|
32 |
+
gr.update(visible=is_path),
|
33 |
+
gr.update(visible=is_subject or is_text or is_web),
|
34 |
+
gr.update(value=subject_val),
|
35 |
+
gr.update(value=description_val),
|
36 |
+
gr.update(value=text_val),
|
37 |
+
gr.update(value=url_val),
|
38 |
+
gr.update(value=None),
|
39 |
+
gr.update(value=None),
|
40 |
+
gr.update(value=""),
|
41 |
+
gr.update(value=""),
|
42 |
+
gr.update(value="", visible=False),
|
43 |
+
gr.update(value=0, visible=False),
|
44 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
|
47 |
def use_selected_subjects(subjects_df: pd.DataFrame | None):
|