Skip to content

Commit 79c43e4

Browse files
authored
abort find_alignment on empty input (#1090)
1 parent 5f9ac65 commit 79c43e4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

whisper/timing.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ def find_alignment(
170170
medfilt_width: int = 7,
171171
qk_scale: float = 1.0,
172172
) -> List[WordTiming]:
173+
if len(text_tokens) == 0:
174+
return []
175+
173176
tokens = torch.tensor(
174177
[
175178
*tokenizer.sot_sequence,

0 commit comments

Comments
 (0)