mirror of
https://github.com/openai/whisper.git
synced 2025-11-26 15:35:57 +00:00
Merge f53a161d55bc6cffc2aab066697be14753cd85c7 into c0d2f624c09dc18e709e37c2ad90c039a4eb72a2
This commit is contained in:
commit
05fd95f64c
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user