lower actual temp used when temp=0

This commit is contained in:
Concedo 2023-08-07 11:05:06 +08:00
parent 0e41b94f40
commit 6659652c9f

View file

@ -243,7 +243,7 @@ void sample_temperature(llama_token_data_array * candidates_p, float temp)
if (temp <= 0) if (temp <= 0)
{ {
// Imitate greedy sampling // Imitate greedy sampling
temp = 0.01f; //cannot be zero else div0 temp = 0.00390625f; //cannot be zero else div0, this is 1/256
llama_sample_temperature(nullptr, candidates_p, temp); llama_sample_temperature(nullptr, candidates_p, temp);
llama_sample_top_k(nullptr, candidates_p, 1, 1); //only want first candidate llama_sample_top_k(nullptr, candidates_p, 1, 1); //only want first candidate
} }