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 --- GUI/GUI/GUI/Frame.cpp | 1 + Scripts/transcribe_v2.py | 16 +++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/GUI/GUI/GUI/Frame.cpp b/GUI/GUI/GUI/Frame.cpp index 0cdd99e..0c83742 100644 --- a/GUI/GUI/GUI/Frame.cpp +++ b/GUI/GUI/GUI/Frame.cpp @@ -463,6 +463,7 @@ namespace { "medium", "large-v1", "large-v2", + "yumfood/whisper_distil_large_v2_ct2", }; const size_t kNumModelChoices = sizeof(kModelChoices) / sizeof(kModelChoices[0]); constexpr int kModelDefault = 2; // base.en 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