only pad timestamps if not using VAD

This commit is contained in:
Max Bain
2023-01-26 10:46:13 +00:00
parent 312f1cc50c
commit 16d24b1c96

View File

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