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
This commit is contained in:
@@ -661,14 +661,6 @@ class WhisperModel:
|
|||||||
# skip silence before possible hallucinations
|
# skip silence before possible hallucinations
|
||||||
if options.hallucination_silence_threshold is not None:
|
if options.hallucination_silence_threshold is not None:
|
||||||
threshold = options.hallucination_silence_threshold
|
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
|
# if first segment might be a hallucination, skip leading silence
|
||||||
first_segment = next_words_segment(current_segments)
|
first_segment = next_words_segment(current_segments)
|
||||||
|
|||||||
Reference in New Issue
Block a user