summaryrefslogtreecommitdiff
path: root/tests/test-sampling.cpp
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 /tests/test-sampling.cpp
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 'tests/test-sampling.cpp')
-rw-r--r--tests/test-sampling.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test-sampling.cpp b/tests/test-sampling.cpp
index c3b3d662..6374958f 100644
--- a/tests/test-sampling.cpp
+++ b/tests/test-sampling.cpp
@@ -235,6 +235,8 @@ int main(void) {
test_top_k({0.1f, 0.2f, 0.3f, 0.4f}, {0.4f}, 1);
test_top_k({0.1f, 0.2f, 0.3f, 0.4f}, {0.4f, 0.3f, 0.2f}, 3);
+ test_top_k({0.1f, 0.2f, 0.3f, 0.4f}, {0.4f, 0.3f, 0.2f, 0.1f}, 4);
+ test_top_k({0.1f, 0.2f, 0.3f, 0.4f}, {0.4f, 0.3f, 0.2f, 0.1f}, 0);
test_top_p({0.1f, 0.2f, 0.3f, 0.4f}, {0.4f}, 0);
test_top_p({0.1f, 0.2f, 0.3f, 0.4f}, {0.4f, 0.3f}, 0.7f);