From 8e6a0e1017cf92af15cd78b52032c832b7f030b1 Mon Sep 17 00:00:00 2001 From: Jonathan Baudanza Date: Wed, 7 Feb 2024 15:58:33 +0900 Subject: [PATCH] Restrict seek_clip_end value to content_frames --- whisper/transcribe.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/whisper/transcribe.py b/whisper/transcribe.py index 1c075a2..5cefe85 100644 --- a/whisper/transcribe.py +++ b/whisper/transcribe.py @@ -261,6 +261,8 @@ def transcribe( # while seek < seek_clip_end while clip_idx < len(seek_clips): seek_clip_start, seek_clip_end = seek_clips[clip_idx] + if seek_clip_end > content_frames: + seek_clip_end = content_frames if seek < seek_clip_start: seek = seek_clip_start if seek >= seek_clip_end: