mirror of
https://github.com/open-webui/open-webui.git
synced 2026-01-02 06:35:20 +00:00
enh: WHISPER_COMPUTE_TYPE env var
This commit is contained in:
parent
475dd91ed7
commit
26af1f92e2
2 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue