Skip to content

Commit 48a855f

Browse files
committed
whisper : log lang_id to troubleshoot language detection
1 parent cce5daf commit 48a855f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/whisper.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3989,6 +3989,7 @@ int whisper_lang_max_id(void) {
39893989
}
39903990

39913991
int whisper_lang_id(const char * lang) {
3992+
WHISPER_LOG_INFO("%s: [danbev] lang '%s'\n", __func__, lang);
39923993
if (!g_lang.count(lang)) {
39933994
for (const auto & kv : g_lang) {
39943995
if (kv.second.second == lang) {
@@ -5502,6 +5503,7 @@ int whisper_full_with_state(
55025503
std::vector<float> probs(whisper_lang_max_id() + 1, 0.0f);
55035504

55045505
const auto lang_id = whisper_lang_auto_detect_with_state(ctx, state, 0, params.n_threads, probs.data());
5506+
WHISPER_LOG_INFO("%s: [danbev] lang_id: %d\n", __func__, lang_id);
55055507
if (lang_id < 0) {
55065508
WHISPER_LOG_ERROR("%s: failed to auto-detect language\n", __func__);
55075509
return -3;

0 commit comments

Comments
 (0)