llama : use std::abs in llama_sample_tail_free (#2800)

Plain 'abs' casts the input to int.
This commit is contained in:
Cebtenzzre 2023-08-26 12:53:52 -04:00 committed by GitHub
parent 04f4b1eb10
commit 50526f37eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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