Skip to content

Commit b4ba248

Browse files
committed
use float literals
1 parent 4f80618 commit b4ba248

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/llama-sampling.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,16 +1099,16 @@ static void llama_sampler_temp_adaptive_apply(struct llama_sampler * /*smpl*/, l
10991099

11001100
// calculate beta
11011101
float beta = 0.0f;
1102-
if (entropy > 0.5) { // don't overcorrect low-entropy heads
1103-
beta = -0.037 * powf(entropy, 4)
1104-
+ 0.481 * powf(entropy, 3)
1105-
+ -2.3 * powf(entropy, 2)
1106-
+ 4.917 * entropy
1107-
+ -1.791;
1102+
if (entropy > 0.5f) { // don't overcorrect low-entropy heads
1103+
beta = -0.037f * powf(entropy, 4)
1104+
+ 0.481f * powf(entropy, 3)
1105+
+ -2.300f * powf(entropy, 2)
1106+
+ 4.917f * entropy
1107+
+ -1.791f;
11081108
// never increase entropy
1109-
beta = (beta < 1.0) ? 1.0 : beta;
1109+
beta = (beta < 1.0f) ? 1.0f : beta;
11101110
} else {
1111-
beta = 1.0;
1111+
beta = 1.0f;
11121112
}
11131113

11141114
// beta = 1 / temp

0 commit comments

Comments
 (0)