gladguy commited on
Commit
7480d2a
·
1 Parent(s): 3e214e7

Add loading state to Start VIVA button

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -801,6 +801,9 @@ with gr.Blocks(title="AnatomyBot - MBBS Anatomy Tutor") as demo:
801
 
802
  # Start VIVA Mode
803
  start_viva_btn.click(
 
 
 
804
  fn=start_viva_mode,
805
  inputs=[current_topic, current_image_state],
806
  outputs=[
@@ -813,6 +816,12 @@ with gr.Blocks(title="AnatomyBot - MBBS Anatomy Tutor") as demo:
813
  ).then(
814
  fn=lambda: gr.update(selected=1), # Switch to VIVA tab
815
  outputs=[tabs]
 
 
 
 
 
 
816
  ).then(
817
  fn=lambda: 0, # Reset question index
818
  outputs=[current_question_idx]
 
801
 
802
  # Start VIVA Mode
803
  start_viva_btn.click(
804
+ fn=lambda: gr.update(value="⏳ Processing VIVA Question...", interactive=False),
805
+ outputs=[start_viva_btn]
806
+ ).then(
807
  fn=start_viva_mode,
808
  inputs=[current_topic, current_image_state],
809
  outputs=[
 
816
  ).then(
817
  fn=lambda: gr.update(selected=1), # Switch to VIVA tab
818
  outputs=[tabs]
819
+ ).then(
820
+ fn=lambda: gr.update(value="🎯 Start VIVA Training", interactive=True), # Reset button
821
+ outputs=[start_viva_btn]
822
+ ).then(
823
+ fn=lambda: gr.update(selected=1), # Switch to VIVA tab
824
+ outputs=[tabs]
825
  ).then(
826
  fn=lambda: 0, # Reset question index
827
  outputs=[current_question_idx]