llama : simplify write_header()
This commit is contained in:
parent
6e29ed52fb
commit
5c85332e99
1 changed files with 4 additions and 11 deletions
|
@ -709,17 +709,10 @@ struct gguf_file_saver {
|
||||||
}
|
}
|
||||||
|
|
||||||
void write_header() {
|
void write_header() {
|
||||||
const int32_t magic = GGUF_MAGIC;
|
file.write_i32(GGUF_MAGIC);
|
||||||
file.write_i32(magic);
|
file.write_i32(GGUF_VERSION);
|
||||||
|
file.write_i32(gguf_get_n_tensors(fl->gguf_ctx));
|
||||||
const int32_t version = GGUF_VERSION;
|
file.write_i32(gguf_get_n_kv (fl->gguf_ctx));
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void write_kv_arr_str(const std::string & key, enum gguf_type type, int i, int n_arr) {
|
void write_kv_arr_str(const std::string & key, enum gguf_type type, int i, int n_arr) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue