From 83a368e98a7b49621029f3067711fa895a97083f Mon Sep 17 00:00:00 2001 From: zh-plus Date: Wed, 24 Jul 2024 10:00:32 +0800 Subject: [PATCH] Make vad-related parameters configurable for batched inference. (#923) --- faster_whisper/transcribe.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/faster_whisper/transcribe.py b/faster_whisper/transcribe.py index 2fa233af..2934652f 100644 --- a/faster_whisper/transcribe.py +++ b/faster_whisper/transcribe.py @@ -122,6 +122,8 @@ def __init__( device: Union[int, str, "torch.device"] = -1, chunk_length: int = 30, vad_device: Union[int, str, "torch.device"] = "auto", + vad_onset: float = 0.500, + vad_offset: float = 0.363, framework="pt", language: Optional[str] = None, **kwargs, @@ -133,8 +135,8 @@ def __init__( self._batch_size = kwargs.pop("batch_size", None) self._num_workers = 0 self.use_vad_model = use_vad_model - self.vad_onset = 0.500 - self.vad_offset = 0.363 + self.vad_onset = vad_onset + self.vad_offset = vad_offset self.vad_model_path = os.path.join(get_assets_path(), "pyannote_vad_model.bin") self.vad_model = None