diff options
Diffstat (limited to 'Scripts/transcribe_v2.py')
| -rw-r--r-- | Scripts/transcribe_v2.py | 16 |
1 files changed, 7 insertions, 9 deletions
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, |
