From 88cca45bb889ca3dc5732aa95b1c493b67dcb453 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Mon, 1 Dec 2025 18:02:34 +0200 Subject: [PATCH] sampling : fix top_p empty condition --- src/llama-sampling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llama-sampling.cpp b/src/llama-sampling.cpp index cf5b0e010f..db7f2770b5 100644 --- a/src/llama-sampling.cpp +++ b/src/llama-sampling.cpp @@ -1287,7 +1287,7 @@ static struct llama_sampler_i llama_sampler_top_p_i = { }; struct llama_sampler * llama_sampler_init_top_p(float p, size_t min_keep) { - const bool is_empty = (p <= 0.0f); + const bool is_empty = p >= 1.0f; if (is_empty) { return llama_sampler_init_empty("top-p?");