Update ui/components.py
Browse files- ui/components.py +10 -6
ui/components.py
CHANGED
|
@@ -113,7 +113,7 @@ def create_streaming_voice_components() -> tuple:
|
|
| 113 |
|
| 114 |
with gr.Row():
|
| 115 |
with gr.Column(scale=1):
|
| 116 |
-
# Microphone component
|
| 117 |
microphone = gr.Microphone(
|
| 118 |
label="🎙️ Nhấn và nói",
|
| 119 |
type="numpy",
|
|
@@ -160,12 +160,16 @@ def create_streaming_voice_components() -> tuple:
|
|
| 160 |
interactive=False,
|
| 161 |
autoplay=True
|
| 162 |
)
|
| 163 |
-
|
| 164 |
-
# Hidden state
|
| 165 |
-
conversation_state = gr.State(value={})
|
| 166 |
|
|
|
|
| 167 |
return (
|
| 168 |
-
microphone,
|
| 169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
)
|
| 171 |
|
|
|
|
| 113 |
|
| 114 |
with gr.Row():
|
| 115 |
with gr.Column(scale=1):
|
| 116 |
+
# Microphone component
|
| 117 |
microphone = gr.Microphone(
|
| 118 |
label="🎙️ Nhấn và nói",
|
| 119 |
type="numpy",
|
|
|
|
| 160 |
interactive=False,
|
| 161 |
autoplay=True
|
| 162 |
)
|
|
|
|
|
|
|
|
|
|
| 163 |
|
| 164 |
+
# CHỈ TRẢ VỀ 8 GIÁ TRỊ - đã bỏ streaming_state và conversation_history
|
| 165 |
return (
|
| 166 |
+
microphone,
|
| 167 |
+
clear_btn,
|
| 168 |
+
status_display,
|
| 169 |
+
state_display,
|
| 170 |
+
realtime_transcription,
|
| 171 |
+
ai_response,
|
| 172 |
+
tts_output
|
| 173 |
+
# Đã bỏ 2 giá trị cuối: streaming_state, conversation_history
|
| 174 |
)
|
| 175 |
|