abort find_alignment on empty input (#1090)

This commit is contained in:
Jong Wook Kim
2023-03-14 15:47:58 -04:00
committed by GitHub
parent 5f9ac653b7
commit 79c43e4859

View File

@@ -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,