mirror of
https://github.com/open-webui/open-webui
synced 2025-06-15 19:05:04 +00:00
Merge pull request #13376 from Thaniel94/add-whisper-language-constraint
feat: Added WHISPER_LANGUAGE env variable
This commit is contained in:
commit
7b014e44ee
@ -2604,6 +2604,7 @@ WHISPER_VAD_FILTER = PersistentConfig(
|
||||
os.getenv("WHISPER_VAD_FILTER", "False").lower() == "true",
|
||||
)
|
||||
|
||||
WHISPER_LANGUAGE = os.getenv("WHISPER_LANGUAGE", "").lower() or None
|
||||
|
||||
# Add Deepgram configuration
|
||||
DEEPGRAM_API_KEY = PersistentConfig(
|
||||
|
@ -173,6 +173,7 @@ from open_webui.config import (
|
||||
WEB_LOADER_ENGINE,
|
||||
WHISPER_MODEL,
|
||||
WHISPER_VAD_FILTER,
|
||||
WHISPER_LANGUAGE,
|
||||
DEEPGRAM_API_KEY,
|
||||
WHISPER_MODEL_AUTO_UPDATE,
|
||||
WHISPER_MODEL_DIR,
|
||||
|
@ -33,6 +33,7 @@ from open_webui.config import (
|
||||
WHISPER_MODEL_AUTO_UPDATE,
|
||||
WHISPER_MODEL_DIR,
|
||||
CACHE_DIR,
|
||||
WHISPER_LANGUAGE
|
||||
)
|
||||
|
||||
from open_webui.constants import ERROR_MESSAGES
|
||||
@ -508,6 +509,7 @@ def transcribe(request: Request, file_path):
|
||||
file_path,
|
||||
beam_size=5,
|
||||
vad_filter=request.app.state.config.WHISPER_VAD_FILTER,
|
||||
language=WHISPER_LANGUAGE
|
||||
)
|
||||
log.info(
|
||||
"Detected language '%s' with probability %f"
|
||||
|
Loading…
Reference in New Issue
Block a user