server : return language in detect response (#4035)

Resolves: https://github.com/ggml-org/whisper.cpp/issues/3603
This commit is contained in:
Álvaro Justen
2026-09-08 07:12:52 +02:00
committed by GitHub
parent 52a939a2a7
commit 61e6ccade0
+3
View File
@@ -1165,6 +1165,9 @@ int main(int argc, char ** argv) {
json jres = json{
{"text", results}
};
if (params.detect_language) {
jres["language"] = whisper_lang_str_full(whisper_full_lang_id(ctx));
}
res.set_content(jres.dump(-1, ' ', false, json::error_handler_t::replace),
"application/json");
}