From 7b996502e7488a01321b4b7890890bcb89cc6878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20G=C3=A4=C3=9Fler?= Date: Thu, 8 Feb 2024 09:45:58 +0100 Subject: [PATCH] Update llama.cpp Co-authored-by: Georgi Gerganov --- llama.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llama.cpp b/llama.cpp index 72457ec0c..27a6277eb 100644 --- a/llama.cpp +++ b/llama.cpp @@ -8371,12 +8371,12 @@ void llama_sample_top_k(struct llama_context * ctx, llama_token_data_array * can // return; // } + const int64_t t_start_sample_us = ggml_time_us(); + if (k <= 0) { k = candidates->size; } - const int64_t t_start_sample_us = ggml_time_us(); - k = std::max(k, (int) min_keep); k = std::min(k, (int) candidates->size);