Skip to content

Commit

Permalink
Switch whisper model cache to /models/ (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
raivisdejus committed Jun 21, 2024
1 parent 4726d58 commit 9e6d722
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions buzz/locale/lv_LV/LC_MESSAGES/buzz.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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..."
Expand Down
5 changes: 2 additions & 3 deletions buzz/model_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

logging.debug("Model root directory: %s", model_root_dir)


class WhisperModelSize(str, enum.Enum):
TINY = "tiny"
BASE = "base"
Expand Down Expand Up @@ -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))

Expand Down

0 comments on commit 9e6d722

Please sign in to comment.