From 4463965401193793fdeef1cdf8b58c75ba246c0f Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Tue, 15 Aug 2023 14:39:27 +0300 Subject: [PATCH] gguf : fix header write --- ggml.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ggml.c b/ggml.c index 19bdc2c0d..754ceda25 100644 --- a/ggml.c +++ b/ggml.c @@ -19303,7 +19303,10 @@ void gguf_write_to_file(struct gguf_context * ctx, const char * fname) { } // write header - fwrite(&ctx->header, sizeof(struct gguf_header), 1, file); + gguf_fwrite_el(file, &ctx->header.magic, sizeof(ctx->header.magic)); + gguf_fwrite_el(file, &ctx->header.version, sizeof(ctx->header.version)); + gguf_fwrite_el(file, &ctx->header.n_kv, sizeof(ctx->header.n_kv)); + gguf_fwrite_el(file, &ctx->header.n_tensors, sizeof(ctx->header.n_tensors)); // write key-value pairs for (uint32_t i = 0; i < ctx->header.n_kv; ++i) {