mirror of
https://github.com/ggml-org/whisper.cpp.git
synced 2026-09-30 19:41:14 +02:00
server : return language in detect response (#4035)
Resolves: https://github.com/ggml-org/whisper.cpp/issues/3603
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user