fix: use set_language(None) for auto-detect instead of set_detect_language(true)
All checks were successful
Build & Push Docker Image / build-and-push (push) Successful in 6m43s

detect_language=true causes whisper.cpp to return 0 immediately after
language detection without running the decoder (whisper.cpp source:
  if (params.detect_language) { return 0; }
Setting language=null triggers auto-detection AND transcription.

This was the root cause of 0 segments on all jobs without explicit language.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
mozempk
2026-05-06 02:58:35 +02:00
parent ef9c04b070
commit 6327ffc09d

View File

@@ -90,7 +90,10 @@ impl Transcriber {
if let Some(lang) = language {
fp.set_language(Some(lang));
} else {
fp.set_detect_language(true);
// Setting language to None (null) triggers whisper's auto-detection AND transcription.
// set_detect_language(true) is WRONG: it causes whisper to return 0 after language
// detection without transcribing (see whisper.cpp: `if (detect_language) return 0`).
fp.set_language(None);
}
fp.set_translate(task == "translate");