summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJohannes Gäßler <johannesg@5d6.de>2024-02-08 09:46:30 +0100
committerGitHub <noreply@github.com>2024-02-08 09:46:30 +0100
commit26d4efd11e48908e14e2ee9471a7fc4c57079a1d (patch)
tree04c16bf0611e416a0f5a792672f276a3cc55af7f /common
parent8504d2d0da8cc7a1f2eee0e9e56949f960510b75 (diff)
sampling: fix top_k <= 0 (#5388)
* sampling: fix top_k <= 0 * Update llama.cpp Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Diffstat (limited to 'common')
-rw-r--r--common/sampling.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/sampling.cpp b/common/sampling.cpp
index e8675a8c..844ad7c5 100644
--- a/common/sampling.cpp
+++ b/common/sampling.cpp
@@ -132,7 +132,7 @@ static void sampler_queue(
const float temp = params.temp;
const float dynatemp_range = params.dynatemp_range;
const float dynatemp_exponent = params.dynatemp_exponent;
- const int32_t top_k = params.top_k <= 0 ? n_vocab : params.top_k;
+ const int32_t top_k = params.top_k;
const float top_p = params.top_p;
const float min_p = params.min_p;
const float tfs_z = params.tfs_z;