mirror of
https://github.com/m-bain/whisperX.git
synced 2025-07-01 18:17:27 -04:00
only pad timestamps if not using VAD
This commit is contained in:
@ -188,9 +188,11 @@ def align(
|
|||||||
transcription_cleaned = "".join(clean_char)
|
transcription_cleaned = "".join(clean_char)
|
||||||
tokens = [model_dictionary[c] for c in transcription_cleaned]
|
tokens = [model_dictionary[c] for c in transcription_cleaned]
|
||||||
|
|
||||||
# pad according original timestamps
|
# we only pad if not using VAD filtering
|
||||||
t1 = max(segment["start"] - extend_duration, 0)
|
if "seg_text" not in segment:
|
||||||
t2 = min(segment["end"] + extend_duration, MAX_DURATION)
|
# pad according original timestamps
|
||||||
|
t1 = max(segment["start"] - extend_duration, 0)
|
||||||
|
t2 = min(segment["end"] + extend_duration, MAX_DURATION)
|
||||||
|
|
||||||
# use prev_t2 as current t1 if it"s later
|
# use prev_t2 as current t1 if it"s later
|
||||||
if start_from_previous and t1 < prev_t2:
|
if start_from_previous and t1 < prev_t2:
|
||||||
|
Reference in New Issue
Block a user