From 149aaca5542c809e0c5a366f6ba45f52298b8aa9 Mon Sep 17 00:00:00 2001 From: mrq Date: Sat, 6 May 2023 10:45:17 +0000 Subject: [PATCH] fixed the whisperx has no attribute named load_model whatever because I guess whisperx has as stable of an API as I do --- src/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/utils.py b/src/utils.py index e8f2a46..597f547 100755 --- a/src/utils.py +++ b/src/utils.py @@ -3660,9 +3660,12 @@ def load_whisper_model(language=None, model_name=None, progress=None): b_lang = language.encode('ascii') whisper_model = Whisper(model_name, models_dir='./models/', language=b_lang) elif args.whisper_backend == "m-bain/whisperx": - import whisperx + import whisper, whisperx device = "cuda" if get_device_name() == "cuda" else "cpu" - whisper_model = whisperx.load_model(model_name, device) + try: + whisper_model = whisperx.load_model(model_name, device) + except Exception as e: + whisper_model = whisper.load_model(model_name, device) if not args.hf_token: print("No huggingface token used, needs to be saved in environment variable, otherwise will throw error loading VAD model.")