Skip to content

Commit

Permalink
abort find_alignment on empty input (openai#1090)
Browse files Browse the repository at this point in the history
  • Loading branch information
jongwook committed Mar 14, 2023
1 parent 5f9ac65 commit 79c43e4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions whisper/timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 79c43e4

Please sign in to comment.