Skip to content

Commit

Permalink
Prevent infinite loop for out-of-bound timestamps in clip_timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
Purfview authored Feb 21, 2024
1 parent 22c75d0 commit 4e1e046
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions faster_whisper/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,8 @@ def generate_segments(
# 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:
Expand Down

0 comments on commit 4e1e046

Please sign in to comment.