mirror of
https://github.com/m-bain/whisperX.git
synced 2025-07-01 18:17:27 -04:00
Added Python 3.7 compatibility
- removed use of walrus operator in favor of `np.cumsum`
This commit is contained in:
@ -243,9 +243,8 @@ def align(
|
|||||||
if "seg-text" not in segment:
|
if "seg-text" not in segment:
|
||||||
segment["seg-text"] = [transcription]
|
segment["seg-text"] = [transcription]
|
||||||
|
|
||||||
v = 0
|
|
||||||
seg_lens = [0] + [len(x) for x in segment["seg-text"]]
|
seg_lens = [0] + [len(x) for x in segment["seg-text"]]
|
||||||
seg_lens_cumsum = [v := v + n for n in seg_lens]
|
seg_lens_cumsum = list(np.cumsum(seg_lens))
|
||||||
sub_seg_idx = 0
|
sub_seg_idx = 0
|
||||||
|
|
||||||
wdx = 0
|
wdx = 0
|
||||||
|
Reference in New Issue
Block a user