]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
android : fix KV cache log message condition (#12212)
authorHan Yin <redacted>
Thu, 6 Mar 2025 06:22:49 +0000 (22:22 -0800)
committerGitHub <redacted>
Thu, 6 Mar 2025 06:22:49 +0000 (08:22 +0200)
examples/llama.android/llama/src/main/cpp/llama-android.cpp

index 2a73983a9832fb97961d32d44b9a894ccf5843d1..0de61ce77c4fa56d6178fef0d35cb149c96928e9 100644 (file)
@@ -361,7 +361,7 @@ Java_android_llama_cpp_LLamaAndroid_completion_1init(
     const auto tokens_list = common_tokenize(context, text, true, parse_special);
 
     auto n_ctx = llama_n_ctx(context);
-    auto n_kv_req = tokens_list.size() + (n_len - tokens_list.size());
+    auto n_kv_req = tokens_list.size() + n_len;
 
     LOGi("n_len = %d, n_ctx = %d, n_kv_req = %d", n_len, n_ctx, n_kv_req);