use float literals

This commit is contained in:
Michael Coppola 2024-10-26 03:25:53 -04:00
parent 4f80618716
commit b4ba248694

View file

@ -1099,16 +1099,16 @@ static void llama_sampler_temp_adaptive_apply(struct llama_sampler * /*smpl*/, l
// calculate beta // calculate beta
float beta = 0.0f; float beta = 0.0f;
if (entropy > 0.5) { // don't overcorrect low-entropy heads if (entropy > 0.5f) { // don't overcorrect low-entropy heads
beta = -0.037 * powf(entropy, 4) beta = -0.037f * powf(entropy, 4)
+ 0.481 * powf(entropy, 3) + 0.481f * powf(entropy, 3)
+ -2.3 * powf(entropy, 2) + -2.300f * powf(entropy, 2)
+ 4.917 * entropy + 4.917f * entropy
+ -1.791; + -1.791f;
// never increase entropy // never increase entropy
beta = (beta < 1.0) ? 1.0 : beta; beta = (beta < 1.0f) ? 1.0f : beta;
} else { } else {
beta = 1.0; beta = 1.0f;
} }
// beta = 1 / temp // beta = 1 / temp