From eff9353773929244a233c548cb4de73789d84e80 Mon Sep 17 00:00:00 2001 From: Ryan Heise Date: Fri, 23 Feb 2024 19:31:25 +1100 Subject: [PATCH] Fix window end heuristic for hallucination_silence_threshold --- whisper/transcribe.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/whisper/transcribe.py b/whisper/transcribe.py index 1c075a201..6a142790d 100644 --- a/whisper/transcribe.py +++ b/whisper/transcribe.py @@ -402,14 +402,6 @@ def next_words_segment(segments: List[dict]) -> Optional[dict]: # skip silence before possible hallucinations if hallucination_silence_threshold is not None: threshold = 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 * 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)