Download file_dashboard.py from ankban/CommTutor: direct link, hf CLI and curl.
- Browser
- Download file 780 Bytes
-
https://huggingface.co/spaces/ankban/CommTutor/resolve/main/file_dashboard.py
- Command line
-
hf download hf://spaces/ankban/CommTutor/file_dashboard.py
-
curl -L -o file_dashboard.py https://huggingface.co/spaces/ankban/CommTutor/resolve/main/file_dashboard.py
780 Bytes
| import gradio as gr | |
| from file_viewer_panel import file_viewer_dashboard | |
| from file_study_guide_panel import file_study_guide_dashboard | |
| def file_based_learning_router(nickname): | |
| with gr.Column(scale=4, elem_id="main-column") as router: | |
| view_state = gr.State("study") | |
| study_panel = gr.Column(visible=False) | |
| viewer_panel = gr.Column(visible=False) | |
| with study_panel: | |
| file_study_guide_dashboard(nickname) | |
| with viewer_panel: | |
| file_viewer_dashboard(nickname) | |
| def switch_view(mode): | |
| return ( | |
| gr.update(visible=(mode == "study")), | |
| gr.update(visible=(mode == "file")), | |
| mode | |
| ) | |
| return router, switch_view, study_panel, viewer_panel | |