From 4542a2d7c1e071e5d10b2d3c285bd1383d0f2292 Mon Sep 17 00:00:00 2001 From: Welkin <60867445+Adorable-Qin@users.noreply.github.com> Date: Wed, 20 Dec 2023 21:30:48 +0800 Subject: [PATCH] Debug for Whisper Extractor (#48) whisper extractor: avoid unbound case of the download_root --- processors/content_extractor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/processors/content_extractor.py b/processors/content_extractor.py index ec0b3959..a116e37f 100644 --- a/processors/content_extractor.py +++ b/processors/content_extractor.py @@ -198,6 +198,11 @@ def load_model(self): elif os.path.isdir(self.cfg.preprocess.whisper_model_path): # "pretrained/whisper" download_root = self.cfg.preprocess.whisper_model_path + else: + # if the path does not exist, download the model to the path + download_root = self.cfg.preprocess.whisper_model_path + if download_root.endswith(".pt"): + download_root = os.path.dirname(download_root) else: download_root = None