From: Liu Jia Date: Mon, 12 Aug 2024 09:46:03 +0000 (+0800) Subject: Fix a spelling mistake (#9001) X-Git-Tag: upstream/0.0.4488~914 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=2589292cde038ba876c041bcd7b3f0c81f3f11fe;p=pkg%2Fggml%2Fsources%2Fllama.cpp Fix a spelling mistake (#9001) --- diff --git a/src/llama-sampling.cpp b/src/llama-sampling.cpp index 8910f6d6..8f4841d9 100644 --- a/src/llama-sampling.cpp +++ b/src/llama-sampling.cpp @@ -85,14 +85,14 @@ void llama_sample_top_k_impl(struct llama_sampling * smpl, llama_token_data_arra constexpr float bucket_low = -10.0f; constexpr float bucket_high = 10.0f; constexpr float bucket_scale = nbuckets/(bucket_high - bucket_low); - constexpr float bucker_inter = -bucket_low * bucket_scale; + constexpr float bucket_inter = -bucket_low * bucket_scale; std::vector bucket_idx(candidates->size); std::vector histo(nbuckets, 0); for (int i = 0; i < (int)candidates->size; ++i) { const float val = candidates->data[i].logit; - int ib = int(bucket_scale * val + bucker_inter); //nbuckets * (val - bucket_low) / (bucket_high - bucket_low); + int ib = int(bucket_scale * val + bucket_inter); //nbuckets * (val - bucket_low) / (bucket_high - bucket_low); ib = std::max(0, std::min(nbuckets-1, ib)); bucket_idx[i] = ib; ++histo[ib];