diff --git a/whisper/timing.py b/whisper/timing.py index 1f8f4cf8c..f5d07e5d1 100644 --- a/whisper/timing.py +++ b/whisper/timing.py @@ -170,6 +170,9 @@ def find_alignment( medfilt_width: int = 7, qk_scale: float = 1.0, ) -> List[WordTiming]: + if len(text_tokens) == 0: + return [] + tokens = torch.tensor( [ *tokenizer.sot_sequence,