From 50526f37eba0b28336700890242ff282b949cd83 Mon Sep 17 00:00:00 2001 From: Cebtenzzre Date: Sat, 26 Aug 2023 12:53:52 -0400 Subject: [PATCH] llama : use std::abs in llama_sample_tail_free (#2800) Plain 'abs' casts the input to int. --- llama.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama.cpp b/llama.cpp index 59105db1c..2b88485a8 100644 --- a/llama.cpp +++ b/llama.cpp @@ -3887,7 +3887,7 @@ void llama_sample_tail_free(struct llama_context * ctx, llama_token_data_array * // Calculate absolute value of second derivatives for (size_t i = 0; i < second_derivatives.size(); ++i) { - second_derivatives[i] = abs(second_derivatives[i]); + second_derivatives[i] = std::abs(second_derivatives[i]); } // Normalize the second derivatives