Spaces:
Runtime error
Runtime error
Fix bug when using skip_gaps or expand_into_gaps
#4
by
GkevinOD
- opened
app.py
CHANGED
@@ -109,11 +109,11 @@ class WhisperTranscriber:
|
|
109 |
elif (vad == 'silero-vad-skip-gaps'):
|
110 |
# Silero VAD where non-speech gaps are simply ignored
|
111 |
skip_gaps = self._create_silero_config(NonSpeechStrategy.SKIP, vadMergeWindow, vadMaxMergeSize, vadPadding, vadPromptWindow)
|
112 |
-
result =
|
113 |
elif (vad == 'silero-vad-expand-into-gaps'):
|
114 |
# Use Silero VAD where speech-segments are expanded into non-speech gaps
|
115 |
expand_gaps = self._create_silero_config(NonSpeechStrategy.EXPAND_SEGMENT, vadMergeWindow, vadMaxMergeSize, vadPadding, vadPromptWindow)
|
116 |
-
result =
|
117 |
elif (vad == 'periodic-vad'):
|
118 |
# Very simple VAD - mark every 5 minutes as speech. This makes it less likely that Whisper enters an infinite loop, but
|
119 |
# it may create a break in the middle of a sentence, causing some artifacts.
|
|
|
109 |
elif (vad == 'silero-vad-skip-gaps'):
|
110 |
# Silero VAD where non-speech gaps are simply ignored
|
111 |
skip_gaps = self._create_silero_config(NonSpeechStrategy.SKIP, vadMergeWindow, vadMaxMergeSize, vadPadding, vadPromptWindow)
|
112 |
+
result = self.vad_model.transcribe(audio_path, whisperCallable, skip_gaps)
|
113 |
elif (vad == 'silero-vad-expand-into-gaps'):
|
114 |
# Use Silero VAD where speech-segments are expanded into non-speech gaps
|
115 |
expand_gaps = self._create_silero_config(NonSpeechStrategy.EXPAND_SEGMENT, vadMergeWindow, vadMaxMergeSize, vadPadding, vadPromptWindow)
|
116 |
+
result = self.vad_model.transcribe(audio_path, whisperCallable, expand_gaps)
|
117 |
elif (vad == 'periodic-vad'):
|
118 |
# Very simple VAD - mark every 5 minutes as speech. This makes it less likely that Whisper enters an infinite loop, but
|
119 |
# it may create a break in the middle of a sentence, causing some artifacts.
|