Introduce Whisper model auto-update control.

* Introduce WHISPER_MODEL_AUTO_UPDATE env var
* Pass local_files_only to WhisperModel()
* Handle cases where auto-update is disabled but model is non-existent
This commit is contained in:
Self Denial
2024-04-10 20:30:00 -06:00
parent 9e726a32e6
commit 429242b4d3
2 changed files with 20 additions and 6 deletions

View File

@@ -446,6 +446,9 @@ Query: [query]"""
WHISPER_MODEL = os.getenv("WHISPER_MODEL", "base")
WHISPER_MODEL_DIR = os.getenv("WHISPER_MODEL_DIR", f"{CACHE_DIR}/whisper/models")
WHISPER_MODEL_AUTO_UPDATE = (
os.environ.get("WHISPER_MODEL_AUTO_UPDATE", "").lower() == "true"
)
####################################