Skip to content

Commit 5c85332

Browse files
committed
llama : simplify write_header()
1 parent 6e29ed5 commit 5c85332

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
@@ -709,17 +709,10 @@ struct gguf_file_saver {
709709
}
710710

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

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

0 commit comments

Comments
 (0)