mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-26 03:14:35 +00:00
llama : define non-positive top_k; top_k range check (#779)
* Define non-positive top_k; top_k range check * minor : brackets --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
parent
ff05d05c96
commit
5a8c4f6240
@ -1229,7 +1229,9 @@ static llama_vocab::id llama_sample_top_p_top_k(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sample_top_k(logits_id, top_k);
|
if (top_k > 0 && top_k < n_logits) {
|
||||||
|
sample_top_k(logits_id, top_k);
|
||||||
|
}
|
||||||
|
|
||||||
float maxl = -std::numeric_limits<float>::infinity();
|
float maxl = -std::numeric_limits<float>::infinity();
|
||||||
for (const auto & kv : logits_id) {
|
for (const auto & kv : logits_id) {
|
||||||
|
Loading…
Reference in New Issue
Block a user