From 2df3580c60b2d3122511a1d527e7d5fc7e267ee2 Mon Sep 17 00:00:00 2001 From: Adorable-Qin Date: Wed, 20 Dec 2023 21:07:03 +0800 Subject: [PATCH] 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..7a57f25c 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 is 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