Skip to content

Commit

Permalink
Fix window end heuristic for hallucination_silence_threshold (SYSTRAN…
Browse files Browse the repository at this point in the history
…#706)

Removes the wishful heuristic causing more issues than it's fixing.

Same as openai/whisper#2043

Example of the issue: openai/whisper#1838 (comment)
  • Loading branch information
Purfview authored Feb 29, 2024
1 parent 09cd57e commit 5090cc9
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions faster_whisper/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,14 +661,6 @@ def next_words_segment(segments: List[dict]) -> Optional[dict]:
# 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)
Expand Down

0 comments on commit 5090cc9

Please sign in to comment.