Spaces:
Sleeping
Sleeping
Akis Giannoukos
commited on
Commit
·
74593a5
1
Parent(s):
ea2aa1e
UI changes
Browse files
app.py
CHANGED
|
@@ -585,27 +585,28 @@ def create_demo():
|
|
| 585 |
"""
|
| 586 |
)
|
| 587 |
|
| 588 |
-
with gr.
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
|
|
|
|
| 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()
|