From c0cfcaf66cbccd96f192d6709a661deebf51f297 Mon Sep 17 00:00:00 2001 From: John <78893154+cmp-nct@users.noreply.github.com> Date: Tue, 23 Jan 2024 16:39:16 +0100 Subject: [PATCH] Update llama.cpp --- llama.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama.cpp b/llama.cpp index 2c43d72fb..c3c94347e 100644 --- a/llama.cpp +++ b/llama.cpp @@ -8001,7 +8001,7 @@ void llama_sample_top_k(struct llama_context * ctx, llama_token_data_array * can auto comp = [](const llama_token_data & a, const llama_token_data & b) { return a.logit > b.logit; }; - if (k == (int) candidates->size) { + if (k >= (int) (3*candidates->size /4)) { std::sort(candidates->data, candidates->data + candidates->size, comp); } else { if (k > 3000) {