Merge f53a161d55bc6cffc2aab066697be14753cd85c7 into c0d2f624c09dc18e709e37c2ad90c039a4eb72a2

This commit is contained in:
Jong Wook Kim 2025-06-27 02:27:35 +00:00 committed by GitHub
commit 05fd95f64c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -224,6 +224,8 @@ def find_alignment(
# IndexError: arrays used as indices must be of integer (or boolean) type
return []
word_boundaries = np.pad(np.cumsum([len(t) for t in word_tokens[:-1]]), (1, 0))
if len(word_boundaries) <= 1:
return []
jumps = np.pad(np.diff(text_indices), (1, 0), constant_values=1).astype(bool)
jump_times = time_indices[jumps] / TOKENS_PER_SECOND