summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorm3ndax <adrian.goessl@outlook.com>2023-09-01 15:47:27 +0200
committerGitHub <noreply@github.com>2023-09-01 16:47:27 +0300
commitee8654bcd0146708988a703e54406d5b553712ea (patch)
tree1ebf2b7ce39396b270dacbe3c6c09b7701b1339b
parent49bb9cbe0f598bc43be539b0df8eafb2130cfad3 (diff)
minor : add const qualifiers (#2853)
* made the methods const # Conflicts: # examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp * made method const * Update convert-llama2c-to-ggml.cpp removed write_raw and write_u32 * llama2c : remove misleading const --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
-rw-r--r--examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp2
-rw-r--r--llama.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp b/examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp
index 0b03c9d2..0ee7adc5 100644
--- a/examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp
+++ b/examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp
@@ -637,7 +637,7 @@ void load_vocab(const char *filename, Config *config, struct llama_vocab *vocab)
}
}
-void stuff_karpathy_weights_into_gg(struct ggml_tensor * gg_weights, float * karpathy_weights){
+void stuff_karpathy_weights_into_gg(struct ggml_tensor * gg_weights, const float * karpathy_weights) {
int ct;
switch (gg_weights->n_dims){
case 1:
diff --git a/llama.cpp b/llama.cpp
index 5ca11923..23b251ca 100644
--- a/llama.cpp
+++ b/llama.cpp
@@ -4393,7 +4393,7 @@ struct llama_logit_info {
}
return min_heap;
}
- float probability_from_logit(float logit) {
+ float probability_from_logit(float logit) const {
return normalizer * std::exp(logit - max_l);
}
};