Akis Giannoukos commited on
Commit
74593a5
·
1 Parent(s): ea2aa1e

UI changes

Browse files
Files changed (1) hide show
  1. app.py +22 -21
app.py CHANGED
@@ -585,27 +585,28 @@ def create_demo():
585
  """
586
  )
587
 
588
- with gr.Row():
589
- chatbot = gr.Chatbot(height=400, type="tuples")
590
- with gr.Column():
591
- score_json = gr.JSON(label="PHQ-9 Assessment (live)")
592
- severity_label = gr.Label(label="Severity")
593
- threshold = gr.Slider(0.5, 1.0, value=CONFIDENCE_THRESHOLD_DEFAULT, step=0.05, label="Confidence Threshold (stop when min ≥ τ)")
594
- tts_enable = gr.Checkbox(label="Speak clinician responses (TTS)", value=USE_TTS_DEFAULT)
595
- tts_audio = gr.Audio(label="Clinician voice", interactive=False)
596
- model_id_tb = gr.Textbox(value=current_model_id, label="Chat Model ID", info="e.g., google/gemma-2-2b-it or google/medgemma-4b-it")
597
- with gr.Row():
598
- apply_model_btn = gr.Button("Apply model (no restart)")
599
- # apply_model_restart_btn = gr.Button("Apply model and restart")
600
- model_status = gr.Markdown(value=f"Current model: `{current_model_id}`")
601
-
602
- with gr.Row():
603
- audio = gr.Audio(sources=["microphone"], type="filepath", label="Speak your response (or use text)")
604
- text = gr.Textbox(lines=2, placeholder="Optional: type your response instead of audio")
605
-
606
- with gr.Row():
607
- send_btn = gr.Button("Send")
608
- reset_btn = gr.Button("Reset")
 
609
 
610
  # App state
611
  chat_state = gr.State()
 
585
  """
586
  )
587
 
588
+ with gr.Tabs():
589
+ with gr.TabItem("Chat"):
590
+ with gr.Column():
591
+ chatbot = gr.Chatbot(height=440, type="tuples", label="Conversation")
592
+ with gr.Row():
593
+ audio = gr.Audio(sources=["microphone"], type="filepath", label="Speak your response (or type below)")
594
+ text = gr.Textbox(lines=2, placeholder="Type your message (optional if you speak)")
595
+ with gr.Row():
596
+ send_btn = gr.Button("Send")
597
+ reset_btn = gr.Button("Reset")
598
+ with gr.TabItem("Advanced"):
599
+ with gr.Column():
600
+ score_json = gr.JSON(label="PHQ-9 Assessment (live)")
601
+ severity_label = gr.Label(label="Severity")
602
+ threshold = gr.Slider(0.5, 1.0, value=CONFIDENCE_THRESHOLD_DEFAULT, step=0.05, label="Confidence Threshold (stop when min ≥ τ)")
603
+ tts_enable = gr.Checkbox(label="Speak clinician responses (TTS)", value=USE_TTS_DEFAULT)
604
+ tts_audio = gr.Audio(label="Clinician voice", interactive=False)
605
+ model_id_tb = gr.Textbox(value=current_model_id, label="Chat Model ID", info="e.g., google/gemma-2-2b-it or google/medgemma-4b-it")
606
+ with gr.Row():
607
+ apply_model_btn = gr.Button("Apply model (no restart)")
608
+ # apply_model_restart_btn = gr.Button("Apply model and restart")
609
+ model_status = gr.Markdown(value=f"Current model: `{current_model_id}`")
610
 
611
  # App state
612
  chat_state = gr.State()