Spaces:
Sleeping
Sleeping
Fix gr.File type and restore VIVA tab
Browse files
app.py
CHANGED
|
@@ -621,7 +621,7 @@ with gr.Blocks(title="AnatomyBot - MBBS Anatomy Tutor") as demo:
|
|
| 621 |
# BOOK LEARNING MODE TAB
|
| 622 |
with gr.Tab("📖 Book Learning Mode") as book_tab:
|
| 623 |
# Upload PDF
|
| 624 |
-
pdf_upload = gr.File(label="Upload Anatomy Textbook (PDF)", file_types=[".pdf"], type="
|
| 625 |
upload_status = gr.Markdown()
|
| 626 |
|
| 627 |
# State to hold extracted images and captions
|
|
@@ -671,6 +671,29 @@ with gr.Blocks(title="AnatomyBot - MBBS Anatomy Tutor") as demo:
|
|
| 671 |
|
| 672 |
page_dropdown.change(fn=show_page_analysis, inputs=[page_dropdown, book_images_state, page_captions_state], outputs=[selected_page_image, analysis_output])
|
| 673 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 674 |
|
| 675 |
|
| 676 |
# Event handlers for Learning Mode
|
|
|
|
| 621 |
# BOOK LEARNING MODE TAB
|
| 622 |
with gr.Tab("📖 Book Learning Mode") as book_tab:
|
| 623 |
# Upload PDF
|
| 624 |
+
pdf_upload = gr.File(label="Upload Anatomy Textbook (PDF)", file_types=[".pdf"], type="binary")
|
| 625 |
upload_status = gr.Markdown()
|
| 626 |
|
| 627 |
# State to hold extracted images and captions
|
|
|
|
| 671 |
|
| 672 |
page_dropdown.change(fn=show_page_analysis, inputs=[page_dropdown, book_images_state, page_captions_state], outputs=[selected_page_image, analysis_output])
|
| 673 |
|
| 674 |
+
# VIVA MODE TAB
|
| 675 |
+
with gr.Tab("🎯 VIVA Training Mode") as viva_tab:
|
| 676 |
+
viva_status = gr.Markdown("Click 'Start VIVA Training' from Learning Mode after studying a topic!")
|
| 677 |
+
|
| 678 |
+
with gr.Column(visible=False) as viva_container:
|
| 679 |
+
with gr.Row():
|
| 680 |
+
with gr.Column(scale=1):
|
| 681 |
+
viva_image = gr.Image(label="Reference Image", type="pil", interactive=False)
|
| 682 |
+
|
| 683 |
+
with gr.Column(scale=2):
|
| 684 |
+
current_question_display = gr.Markdown("### Question will appear here")
|
| 685 |
+
hint_display = gr.Markdown("💡 Hint will appear here")
|
| 686 |
+
|
| 687 |
+
student_answer = gr.Textbox(
|
| 688 |
+
label="Your Answer",
|
| 689 |
+
placeholder="Type your answer here...",
|
| 690 |
+
lines=4
|
| 691 |
+
)
|
| 692 |
+
|
| 693 |
+
submit_answer_btn = gr.Button("Submit Answer", variant="primary")
|
| 694 |
+
|
| 695 |
+
feedback_display = gr.Markdown("Feedback will appear here after you submit your answer")
|
| 696 |
+
|
| 697 |
|
| 698 |
|
| 699 |
# Event handlers for Learning Mode
|