Fix: Allow vad options to be configurable by correctly passing down to FasterWhisperPipeline.

This commit is contained in:
Andrew Bettke
2023-10-05 10:06:34 -04:00
parent 07fafa37b3
commit 79801167ac
2 changed files with 16 additions and 3 deletions

View File

@ -260,7 +260,12 @@ def merge_vad(vad_arr, pad_onset=0.0, pad_offset=0.0, min_duration_off=0.0, min_
active_segs = pd.DataFrame([x['segment'] for x in active['content']])
return active_segs
def merge_chunks(segments, chunk_size):
def merge_chunks(
segments,
chunk_size,
onset: float = 0.5,
offset: Optional[float] = None,
):
"""
Merge operation described in paper
"""
@ -270,7 +275,7 @@ def merge_chunks(segments, chunk_size):
speaker_idxs = []
assert chunk_size > 0
binarize = Binarize(max_duration=chunk_size)
binarize = Binarize(max_duration=chunk_size, onset=onset, offset=offset)
segments = binarize(segments)
segments_list = []
for speech_turn in segments.get_timeline():