Update ui/components.py
Browse files- ui/components.py +8 -2
ui/components.py
CHANGED
|
@@ -79,7 +79,12 @@ def create_audio_components() -> tuple:
|
|
| 79 |
return audio_input, transcription_output, response_output, tts_audio_output, process_button
|
| 80 |
|
| 81 |
def create_chat_components() -> tuple:
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
state = gr.State([])
|
| 84 |
|
| 85 |
with gr.Row():
|
|
@@ -95,7 +100,8 @@ def create_chat_components() -> tuple:
|
|
| 95 |
with gr.Row():
|
| 96 |
chat_tts_output = gr.Audio(
|
| 97 |
label="Phản hồi bằng giọng nói",
|
| 98 |
-
interactive=False
|
|
|
|
| 99 |
)
|
| 100 |
|
| 101 |
return chatbot, state, user_input, send_button, clear_button, chat_tts_output
|
|
|
|
| 79 |
return audio_input, transcription_output, response_output, tts_audio_output, process_button
|
| 80 |
|
| 81 |
def create_chat_components() -> tuple:
|
| 82 |
+
"""Tạo components cho chat interface."""
|
| 83 |
+
chatbot = gr.Chatbot(
|
| 84 |
+
label="Chatbot",
|
| 85 |
+
height=500,
|
| 86 |
+
show_copy_button=True
|
| 87 |
+
)
|
| 88 |
state = gr.State([])
|
| 89 |
|
| 90 |
with gr.Row():
|
|
|
|
| 100 |
with gr.Row():
|
| 101 |
chat_tts_output = gr.Audio(
|
| 102 |
label="Phản hồi bằng giọng nói",
|
| 103 |
+
interactive=False,
|
| 104 |
+
visible=True
|
| 105 |
)
|
| 106 |
|
| 107 |
return chatbot, state, user_input, send_button, clear_button, chat_tts_output
|