From cc853fc6ccb22f64643fe6ba5c637b6f822f3f91 Mon Sep 17 00:00:00 2001 From: Arkadiy Kukarkin Date: Sun, 5 Jul 2026 16:28:27 +0200 Subject: [PATCH] fix beam search using wrong parent probability --- native/jni/org_futo_inputmethod_latin_xlm_LanguageModel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/native/jni/org_futo_inputmethod_latin_xlm_LanguageModel.cpp b/native/jni/org_futo_inputmethod_latin_xlm_LanguageModel.cpp index 9fa240c2dd..cc622100ea 100644 --- a/native/jni/org_futo_inputmethod_latin_xlm_LanguageModel.cpp +++ b/native/jni/org_futo_inputmethod_latin_xlm_LanguageModel.cpp @@ -732,13 +732,13 @@ struct LanguageModelState { index_value[i].first); } - if (sequences[i].first > 1.0f || sequences[i].first < 0.0f) { + if (parent_seq.first > 1.0f || parent_seq.first < 0.0f) { AKLOGE("Expected sequences value to be probability [%.2f]", - sequences[i].first); + parent_seq.first); } next_sequences.emplace_back( - index_value[i].first * sequences[i].first, + index_value[i].first * parent_seq.first, potential_sequence_data{ new_sequence, parent_seq.second.seq_id