summaryrefslogtreecommitdiffstats
path: root/Scripts
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2023-12-08 18:13:32 -0800
committeryum <yum.food.vr@gmail.com>2023-12-08 18:13:56 -0800
commit15368618a109eeec69209a6693839eb359ecd190 (patch)
treee953e692c25df4f791b576cd3c649b81ed69704a /Scripts
parentdbb2f72792e2af3ff220313f84bf76a9a1ddbeb4 (diff)
Add distilled whisper large-v2 model
Diffstat (limited to 'Scripts')
-rw-r--r--Scripts/transcribe_v2.py16
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,