Spaces:
Runtime error
Runtime error
Gabriel Kevin Quito
commited on
Commit
·
cfcbb89
1
Parent(s):
84fa1f8
Fix bug when using skip_gaps or expand_into_gaps
Browse filesAttributeError: 'TranscriptionConfig' object has no attribute 'transcribe'
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.
|