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 authored and abyesilyurt committed Nov 13, 2023
1 parent 99239f4 commit 2df019a
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 2df019a

Please sign in to comment.