From 5c85332e99602251909950fdab5e0003441b22dd Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Tue, 15 Aug 2023 11:11:22 +0300 Subject: [PATCH] llama : simplify write_header() --- gguf-llama.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/gguf-llama.cpp b/gguf-llama.cpp index dc97e3bce..4006d3347 100644 --- a/gguf-llama.cpp +++ b/gguf-llama.cpp @@ -709,17 +709,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) {