llama : add option for greedy sampling with probs (#3813)

* llama : add option for greedy sampling with probs

* llama : add comment about llama_sample_token_greedy() missing probs

* sampling : temp == 0.0 -> no probs, temp < 0.0 -> probs
This commit is contained in:
Georgi Gerganov
2023-10-28 14:23:11 +03:00
committed by GitHub
parent 177461104b
commit ee1a0ec9cb
4 changed files with 9 additions and 3 deletions

View File

@ -658,6 +658,7 @@ extern "C" {
float * mu);
/// @details Selects the token with the highest probability.
/// Does not compute the token probabilities. Use llama_sample_softmax() instead.
LLAMA_API llama_token llama_sample_token_greedy(
struct llama_context * ctx,
llama_token_data_array * candidates);