Преглед изворни кода

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>
m3ndax пре 2 година
родитељ
комит
ee8654bcd0
2 измењених фајлова са 2 додато и 2 уклоњено
  1. 1 1
      examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp
  2. 1 1
      llama.cpp

+ 1 - 1
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;
     int ct;
     switch (gg_weights->n_dims){
     switch (gg_weights->n_dims){
         case 1:
         case 1:

+ 1 - 1
llama.cpp

@@ -4393,7 +4393,7 @@ struct llama_logit_info {
         }
         }
         return min_heap;
         return min_heap;
     }
     }
-    float probability_from_logit(float logit) {
+    float probability_from_logit(float logit) const {
         return normalizer * std::exp(logit - max_l);
         return normalizer * std::exp(logit - max_l);
     }
     }
 };
 };