mirror of
https://github.com/openai/whisper.git
synced 2025-11-24 06:26:03 +00:00
abort find_alignment on empty input
This commit is contained in:
parent
5f9ac653b7
commit
24ba319e70
@ -170,6 +170,9 @@ def find_alignment(
|
|||||||
medfilt_width: int = 7,
|
medfilt_width: int = 7,
|
||||||
qk_scale: float = 1.0,
|
qk_scale: float = 1.0,
|
||||||
) -> List[WordTiming]:
|
) -> List[WordTiming]:
|
||||||
|
if len(text_tokens) == 0:
|
||||||
|
return []
|
||||||
|
|
||||||
tokens = torch.tensor(
|
tokens = torch.tensor(
|
||||||
[
|
[
|
||||||
*tokenizer.sot_sequence,
|
*tokenizer.sot_sequence,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user