From 06135636445a01e55e0c25dd5369adf0ec636812 Mon Sep 17 00:00:00 2001 From: _00_ <131402327+rgaricano@users.noreply.github.com> Date: Tue, 22 Jul 2025 16:47:06 +0200 Subject: [PATCH 1/3] FIX: STT default whisper trascription language FIX: STT default whisper trascription language Fix the transcripcion language used by default whisper, setting as WHISPER_LANGUAGE if it is setted in env var, even if a language is detected in the file's metadata. It is understood that if a language is set as an environment variable for transcriptions, this should be the preferred one and the one that should be used for that purpose. It would be advisable to add this variable as configurable in UI --- backend/open_webui/routers/audio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/routers/audio.py b/backend/open_webui/routers/audio.py index a9aa93e08a..4863c50c7e 100644 --- a/backend/open_webui/routers/audio.py +++ b/backend/open_webui/routers/audio.py @@ -561,7 +561,7 @@ def transcription_handler(request, file_path, metadata): file_path, beam_size=5, vad_filter=request.app.state.config.WHISPER_VAD_FILTER, - language=metadata.get("language") or WHISPER_LANGUAGE, + language=metadata.get("language",None) if WHISPER_LANGUAGE=="" else WHISPER_LANGUAGE, ) log.info( "Detected language '%s' with probability %f" From 51758c429bcf27648792d6352d0d00f026060f0f Mon Sep 17 00:00:00 2001 From: _00_ <131402327+rgaricano@users.noreply.github.com> Date: Wed, 23 Jul 2025 08:45:10 +0200 Subject: [PATCH 2/3] Update audio.py - fix FORMAT error Fix FORMAT error --- backend/open_webui/routers/audio.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/routers/audio.py b/backend/open_webui/routers/audio.py index 4863c50c7e..3249b71188 100644 --- a/backend/open_webui/routers/audio.py +++ b/backend/open_webui/routers/audio.py @@ -561,7 +561,12 @@ def transcription_handler(request, file_path, metadata): file_path, beam_size=5, vad_filter=request.app.state.config.WHISPER_VAD_FILTER, - language=metadata.get("language",None) if WHISPER_LANGUAGE=="" else WHISPER_LANGUAGE, + language=( + metadata.get("language", None) + if WHISPER_LANGUAGE == "" + else WHISPER_LANGUAGE + ), + ) ) log.info( "Detected language '%s' with probability %f" From ab8e54dd29011e987a08347c309dd58aeb57c505 Mon Sep 17 00:00:00 2001 From: _00_ <131402327+rgaricano@users.noreply.github.com> Date: Wed, 23 Jul 2025 08:49:00 +0200 Subject: [PATCH 3/3] Update audio.py Fix Format error Fix Format error --- backend/open_webui/routers/audio.py | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/open_webui/routers/audio.py b/backend/open_webui/routers/audio.py index 3249b71188..b1b715d44b 100644 --- a/backend/open_webui/routers/audio.py +++ b/backend/open_webui/routers/audio.py @@ -566,7 +566,6 @@ def transcription_handler(request, file_path, metadata): if WHISPER_LANGUAGE == "" else WHISPER_LANGUAGE ), - ) ) log.info( "Detected language '%s' with probability %f"