Skip to content

Commit

Permalink
llama : simplify write_header()
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Aug 15, 2023
1 parent 0f694f8 commit 84de6a3
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions gguf-llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,17 +708,10 @@ struct gguf_file_saver {
}

void write_header() {
const int32_t magic = GGUF_MAGIC;
file.write_i32(magic);

const int32_t version = GGUF_VERSION;
file.write_i32(version);

const int32_t n_tensors = gguf_get_n_tensors(fl->gguf_ctx);
file.write_i32(n_tensors);

const int32_t n_kv = gguf_get_n_kv(fl->gguf_ctx);
file.write_i32(n_kv);
file.write_i32(GGUF_MAGIC);
file.write_i32(GGUF_VERSION);
file.write_i32(gguf_get_n_tensors(fl->gguf_ctx));
file.write_i32(gguf_get_n_kv (fl->gguf_ctx));
}

void write_kv_arr_str(const std::string & key, enum gguf_type type, int i, int n_arr) {
Expand Down

0 comments on commit 84de6a3

Please sign in to comment.