fix looping in whisper (#1273)

This commit is contained in:
Awni Hannun 2025-02-10 13:04:35 -08:00 committed by GitHub
parent 5865899c81
commit bded1a8fcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -195,6 +195,8 @@ def transcribe(
seek_points.append(0) seek_points.append(0)
if len(seek_points) % 2 == 1: if len(seek_points) % 2 == 1:
seek_points.append(content_frames) seek_points.append(content_frames)
else:
seek_points[-1] = min(content_frames, seek_points[-1])
seek_clips: List[Tuple[int, int]] = list(zip(seek_points[::2], seek_points[1::2])) seek_clips: List[Tuple[int, int]] = list(zip(seek_points[::2], seek_points[1::2]))
punctuation = "\"'“¿([{-\"'.。,!?::”)]}、" punctuation = "\"'“¿([{-\"'.。,!?::”)]}、"