From 15368618a109eeec69209a6693839eb359ecd190 Mon Sep 17 00:00:00 2001 From: yum Date: Fri, 8 Dec 2023 18:13:32 -0800 Subject: Add distilled whisper large-v2 model --- Scripts/transcribe_v2.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'Scripts') diff --git a/Scripts/transcribe_v2.py b/Scripts/transcribe_v2.py index 4ae17d1..491bc35 100644 --- a/Scripts/transcribe_v2.py +++ b/Scripts/transcribe_v2.py @@ -421,16 +421,14 @@ class Whisper: model_device = "cpu" download_it = os.path.exists(model_root) - model_str = model_str + if '/' in model_str: + hf_hub_download(repo_id=model_str, filename='model.bin', + local_dir=model_root) + hf_hub_download(repo_id=model_str, filename='vocabulary.json', + local_dir=model_root) + hf_hub_download(repo_id=model_str, filename='config.json', + local_dir=model_root) if download_it: - if '/' in model_str: - hf_hub_download(repo_id=model_str, filename='model.bin', - local_dir=model_root) - hf_hub_download(repo_id=model_str, filename='vocabulary.json', - local_dir=model_root) - hf_hub_download(repo_id=model_str, filename='config.json', - local_dir=model_root) - model_str = model_root self.model = WhisperModel(model_str, device = model_device, -- cgit v1.2.3