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

Reset Start VIVA button when searching new topic

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -785,18 +785,20 @@ with gr.Blocks(title="AnatomyBot - MBBS Anatomy Tutor") as demo:
785
  def handle_query(query):
786
  """Handle learning mode query and store topic/image."""
787
  img, info, error = process_anatomy_query(query)
788
- return img, info, error, query, img # Return topic and image for VIVA mode
 
 
789
 
790
  submit_btn.click(
791
  fn=handle_query,
792
  inputs=[query_input],
793
- outputs=[image_output, info_output, error_output, current_topic, current_image_state]
794
  )
795
 
796
  query_input.submit(
797
  fn=handle_query,
798
  inputs=[query_input],
799
- outputs=[image_output, info_output, error_output, current_topic, current_image_state]
800
  )
801
 
802
  # Start VIVA Mode
 
785
  def handle_query(query):
786
  """Handle learning mode query and store topic/image."""
787
  img, info, error = process_anatomy_query(query)
788
+ # Reset Start VIVA button
789
+ viva_btn_update = gr.update(value="🎯 Start VIVA Training", interactive=True)
790
+ return img, info, error, query, img, viva_btn_update # Return topic, image, and button update
791
 
792
  submit_btn.click(
793
  fn=handle_query,
794
  inputs=[query_input],
795
+ outputs=[image_output, info_output, error_output, current_topic, current_image_state, start_viva_btn]
796
  )
797
 
798
  query_input.submit(
799
  fn=handle_query,
800
  inputs=[query_input],
801
+ outputs=[image_output, info_output, error_output, current_topic, current_image_state, start_viva_btn]
802
  )
803
 
804
  # Start VIVA Mode