From 5090cc9d0d3048731d63b4e2fe4bf7cd73ccbfdc Mon Sep 17 00:00:00 2001 From: Purfview <69023953+Purfview@users.noreply.github.com> Date: Thu, 29 Feb 2024 16:59:32 +0000 Subject: [PATCH] Fix window end heuristic for hallucination_silence_threshold (#706) Removes the wishful heuristic causing more issues than it's fixing. Same as https://github.com/openai/whisper/pull/2043 Example of the issue: https://github.com/openai/whisper/pull/1838#issuecomment-1960041500 --- faster_whisper/transcribe.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/faster_whisper/transcribe.py b/faster_whisper/transcribe.py index bce84d2..d3d5deb 100644 --- a/faster_whisper/transcribe.py +++ b/faster_whisper/transcribe.py @@ -661,14 +661,6 @@ class WhisperModel: # skip silence before possible hallucinations if options.hallucination_silence_threshold is not None: threshold = options.hallucination_silence_threshold - if not single_timestamp_ending: - last_word_end = get_end(current_segments) - if last_word_end is not None and last_word_end > time_offset: - remaining_duration = window_end_time - last_word_end - if remaining_duration > threshold: - seek = round(last_word_end * self.frames_per_second) - else: - seek = previous_seek + segment_size # if first segment might be a hallucination, skip leading silence first_segment = next_words_segment(current_segments)