From 244d60e0f1088b4754ebf3471b60e375b22118b8 Mon Sep 17 00:00:00 2001 From: dujing Date: Wed, 10 Jul 2024 11:42:37 +0800 Subject: [PATCH] fix vad model load bug. --- whisperx/asr.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/whisperx/asr.py b/whisperx/asr.py index 0ccaf92b..399bbbdb 100644 --- a/whisperx/asr.py +++ b/whisperx/asr.py @@ -344,7 +344,11 @@ def load_model(whisper_arch, if vad_model is not None: vad_model = vad_model else: - vad_model = load_vad_model(torch.device(device), use_auth_token=None, **default_vad_options) + if device == 'cuda': + device_vad = f'cuda:{device_index}' + else: + device_vad = device + vad_model = load_vad_model(device_vad, use_auth_token=None, **default_vad_options) return FasterWhisperPipeline( model=model,