Merge branch 'master' into concedo_experimental

# Conflicts:
#	CMakeLists.txt
#	README.md
#	tests/test-sampling.cpp
This commit is contained in:
Concedo 2024-02-08 17:33:03 +08:00
commit f374dba49c
4 changed files with 7 additions and 3 deletions

View file

@ -8890,6 +8890,10 @@ void llama_sample_top_k(struct llama_context * ctx, llama_token_data_array * can
// }
const int64_t t_start_sample_us = ggml_time_us();
if (k <= 0) {
k = candidates->size;
}
k = std::max(k, (int) min_keep);
k = std::min(k, (int) candidates->size);