Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/whisper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6805,7 +6805,16 @@ int whisper_full_with_state(
state->lang_id = lang_id;
params.language = whisper_lang_str(lang_id);

WHISPER_LOG_INFO("%s: auto-detected language: %s (p = %f)\n", __func__, params.language, probs[whisper_lang_id(params.language)]);
WHISPER_LOG_INFO("%s: auto-detected language: %s (p = %f)\n", __func__, params.language, probs[lang_id]);
const auto & sorted_logits_id = state->decoders[0].logits_id;
for (const auto & prob : sorted_logits_id) {
const auto lang_id = prob.second;
const char * lang_code = whisper_lang_str(lang_id);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whisper_lang_str will be called N times. We might need to modify whisper_lang_str implementation from map 'iteration' to map 'lookup'.

WHISPER_LOG_INFO("%s: language prob: %s (p = %f)\n",
__func__,
lang_code,
prob.first);
}
if (params.detect_language) {
return 0;
}
Expand Down