Skip to content

Commit

Permalink
Fix window end heuristic for hallucination_silence_threshold
Browse files Browse the repository at this point in the history
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 23, 2024
1 parent 06d32bf commit 1a19e0e
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 @@ -660,14 +660,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 1a19e0e

Please sign in to comment.