Skip to content

Commit 84de6a3

Browse files
committed
llama : simplify write_header()
1 parent 0f694f8 commit 84de6a3

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

gguf-llama.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -708,17 +708,10 @@ struct gguf_file_saver {
708708
}
709709

710710
void write_header() {
711-
const int32_t magic = GGUF_MAGIC;
712-
file.write_i32(magic);
713-
714-
const int32_t version = GGUF_VERSION;
715-
file.write_i32(version);
716-
717-
const int32_t n_tensors = gguf_get_n_tensors(fl->gguf_ctx);
718-
file.write_i32(n_tensors);
719-
720-
const int32_t n_kv = gguf_get_n_kv(fl->gguf_ctx);
721-
file.write_i32(n_kv);
711+
file.write_i32(GGUF_MAGIC);
712+
file.write_i32(GGUF_VERSION);
713+
file.write_i32(gguf_get_n_tensors(fl->gguf_ctx));
714+
file.write_i32(gguf_get_n_kv (fl->gguf_ctx));
722715
}
723716

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

0 commit comments

Comments
 (0)