Skip to content

Commit

Permalink
Fix window end heuristic for hallucination_silence_threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanheise committed Feb 23, 2024
1 parent ba3f3cd commit eff9353
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions whisper/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit eff9353

Please sign in to comment.