Skip to content

Commit

Permalink
avoid unbound case of the download_root
Browse files Browse the repository at this point in the history
  • Loading branch information
Adorable-Qin committed Dec 20, 2023
1 parent d76cf2d commit 2df3580
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions processors/content_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2df3580

Please sign in to comment.