liumaolin
commited on
Commit
·
0cbda14
1
Parent(s):
952b71a
Improve speech recognizer to handle empty transcriptions
Browse files
src/voice_dialogue/services/speech/recognizer.py
CHANGED
|
@@ -39,8 +39,12 @@ class ASRWorker(BaseThread):
|
|
| 39 |
|
| 40 |
voice_task.language = self.language
|
| 41 |
voice_task.whisper_start_time = time.time()
|
|
|
|
| 42 |
user_voice: np.array = voice_task.user_voice
|
| 43 |
transcribed_text = self.client.transcribe(user_voice)
|
|
|
|
|
|
|
|
|
|
| 44 |
voice_task.whisper_end_time = time.time()
|
| 45 |
|
| 46 |
task_id = voice_task.id
|
|
|
|
| 39 |
|
| 40 |
voice_task.language = self.language
|
| 41 |
voice_task.whisper_start_time = time.time()
|
| 42 |
+
|
| 43 |
user_voice: np.array = voice_task.user_voice
|
| 44 |
transcribed_text = self.client.transcribe(user_voice)
|
| 45 |
+
if not transcribed_text.strip():
|
| 46 |
+
continue
|
| 47 |
+
|
| 48 |
voice_task.whisper_end_time = time.time()
|
| 49 |
|
| 50 |
task_id = voice_task.id
|