From 26af1f92e21ddfd08348570bf54a6f345ac69648 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 29 Dec 2025 00:41:47 +0400 Subject: [PATCH] enh: WHISPER_COMPUTE_TYPE env var --- backend/open_webui/config.py | 1 + backend/open_webui/routers/audio.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index bea37ecc44..2f052ca6e0 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -3675,6 +3675,7 @@ WHISPER_MODEL = PersistentConfig( os.getenv("WHISPER_MODEL", "base"), ) +WHISPER_COMPUTE_TYPE = os.getenv("WHISPER_COMPUTE_TYPE", "int8") WHISPER_MODEL_DIR = os.getenv("WHISPER_MODEL_DIR", f"{CACHE_DIR}/whisper/models") WHISPER_MODEL_AUTO_UPDATE = ( not OFFLINE_MODE diff --git a/backend/open_webui/routers/audio.py b/backend/open_webui/routers/audio.py index 120300d49e..4d6c50f089 100644 --- a/backend/open_webui/routers/audio.py +++ b/backend/open_webui/routers/audio.py @@ -38,6 +38,7 @@ from open_webui.utils.auth import get_admin_user, get_verified_user from open_webui.utils.headers import include_user_info_headers from open_webui.config import ( WHISPER_MODEL_AUTO_UPDATE, + WHISPER_COMPUTE_TYPE, WHISPER_MODEL_DIR, CACHE_DIR, WHISPER_LANGUAGE, @@ -129,7 +130,7 @@ def set_faster_whisper_model(model: str, auto_update: bool = False): faster_whisper_kwargs = { "model_size_or_path": model, "device": DEVICE_TYPE if DEVICE_TYPE and DEVICE_TYPE == "cuda" else "cpu", - "compute_type": "int8", + "compute_type": WHISPER_COMPUTE_TYPE, "download_root": WHISPER_MODEL_DIR, "local_files_only": not auto_update, }