From b4ba248694ed74e27794e51b2ef68326ad9e2c14 Mon Sep 17 00:00:00 2001 From: Michael Coppola Date: Sat, 26 Oct 2024 03:25:53 -0400 Subject: [PATCH] use float literals --- src/llama-sampling.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/llama-sampling.cpp b/src/llama-sampling.cpp index c20121013..33c34d5f5 100644 --- a/src/llama-sampling.cpp +++ b/src/llama-sampling.cpp @@ -1099,16 +1099,16 @@ static void llama_sampler_temp_adaptive_apply(struct llama_sampler * /*smpl*/, l // calculate beta float beta = 0.0f; - if (entropy > 0.5) { // don't overcorrect low-entropy heads - beta = -0.037 * powf(entropy, 4) - + 0.481 * powf(entropy, 3) - + -2.3 * powf(entropy, 2) - + 4.917 * entropy - + -1.791; + if (entropy > 0.5f) { // don't overcorrect low-entropy heads + beta = -0.037f * powf(entropy, 4) + + 0.481f * powf(entropy, 3) + + -2.300f * powf(entropy, 2) + + 4.917f * entropy + + -1.791f; // never increase entropy - beta = (beta < 1.0) ? 1.0 : beta; + beta = (beta < 1.0f) ? 1.0f : beta; } else { - beta = 1.0; + beta = 1.0f; } // beta = 1 / temp