From 9e6d722ca95d7dff8574e10f2e88c1e8358bc7d6 Mon Sep 17 00:00:00 2001 From: Raivis Dejus Date: Fri, 21 Jun 2024 15:05:13 +0300 Subject: [PATCH] Switch whisper model cache to /models/ (#808) --- buzz/locale/lv_LV/LC_MESSAGES/buzz.po | 4 ++-- buzz/model_loader.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/buzz/locale/lv_LV/LC_MESSAGES/buzz.po b/buzz/locale/lv_LV/LC_MESSAGES/buzz.po index 6889420c9c..8bb28797d5 100644 --- a/buzz/locale/lv_LV/LC_MESSAGES/buzz.po +++ b/buzz/locale/lv_LV/LC_MESSAGES/buzz.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-06-20 23:14+0300\n" -"PO-Revision-Date: 2024-06-20 23:15+0300\n" +"PO-Revision-Date: 2024-06-21 14:22+0300\n" "Last-Translator: \n" "Language-Team: \n" "Language: lv_LV\n" @@ -451,7 +451,7 @@ msgstr "Lejupielādē modeli" #: buzz/widgets/model_download_progress_dialog.py:37 msgid "remaining" -msgstr "atlicis" +msgstr "!" #: buzz/widgets/menu_bar.py:38 msgid "Import File..." diff --git a/buzz/model_loader.py b/buzz/model_loader.py index ddf00bfdb2..a38b24931a 100644 --- a/buzz/model_loader.py +++ b/buzz/model_loader.py @@ -37,6 +37,7 @@ logging.debug("Model root directory: %s", model_root_dir) + class WhisperModelSize(str, enum.Enum): TINY = "tiny" BASE = "base" @@ -215,9 +216,7 @@ def get_whisper_cpp_file_path(size: WhisperModelSize) -> str: def get_whisper_file_path(size: WhisperModelSize) -> str: - root_dir = os.getenv( - "XDG_CACHE_HOME", os.path.join(os.path.expanduser("~"), ".cache", "whisper") - ) + root_dir = os.path.join(model_root_dir, "whisper") url = whisper._MODELS[size.value] return os.path.join(root_dir, os.path.basename(url))