llama2c : remove misleading const

This commit is contained in:
Georgi Gerganov 2023-09-01 16:46:30 +03:00 committed by GitHub
parent a3c1234bd5
commit 9ec17d8514
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -483,7 +483,7 @@ struct llama_file {
return (size_t) ret; return (size_t) ret;
} }
void seek(size_t offset, int whence) const { void seek(size_t offset, int whence) {
#ifdef _WIN32 #ifdef _WIN32
int ret = _fseeki64(fp, (__int64) offset, whence); int ret = _fseeki64(fp, (__int64) offset, whence);
#else #else
@ -492,7 +492,7 @@ struct llama_file {
GGML_ASSERT(ret == 0); // same GGML_ASSERT(ret == 0); // same
} }
void read_raw(void * ptr, size_t size) const { void read_raw(void * ptr, size_t size) {
if (size == 0) { if (size == 0) {
return; return;
} }
@ -506,18 +506,18 @@ struct llama_file {
} }
} }
std::uint32_t read_u32() const { std::uint32_t read_u32() {
std::uint32_t ret; std::uint32_t ret;
read_raw(&ret, sizeof(ret)); read_raw(&ret, sizeof(ret));
return ret; return ret;
} }
std::float_t read_f32() const { std::float_t read_f32() {
std::float_t ret; std::float_t ret;
read_raw(&ret, sizeof(ret)); read_raw(&ret, sizeof(ret));
return ret; return ret;
} }
std::string read_string(std::uint32_t len) const { std::string read_string(std::uint32_t len) {
std::vector<char> chars(len); std::vector<char> chars(len);
read_raw(chars.data(), len); read_raw(chars.data(), len);
return std::string(chars.data(), len); return std::string(chars.data(), len);
@ -633,7 +633,7 @@ void load_vocab(const char *filename, Config *config, struct llama_vocab *vocab)
} }
} }
void stuff_karpathy_weights_into_gg(struct ggml_tensor * gg_weights, const 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: