From f310f056a5b21acf71cbb11bb00c9d8a2541ff1c Mon Sep 17 00:00:00 2001 From: jhj0517 <97279763+jhj0517@users.noreply.github.com> Date: Sat, 4 Jan 2025 02:09:36 +0900 Subject: [PATCH] Handle empty speech error --- modules/whisper/base_transcription_pipeline.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/whisper/base_transcription_pipeline.py b/modules/whisper/base_transcription_pipeline.py index a561d9f..744c3f3 100644 --- a/modules/whisper/base_transcription_pipeline.py +++ b/modules/whisper/base_transcription_pipeline.py @@ -160,6 +160,8 @@ def run(self, segments=result, speech_chunks=speech_chunks, ) + if not result: + raise ValueError("VAD detected no speech segments in the audio.") if diarization_params.is_diarize: result, elapsed_time_diarization = self.diarizer.run(