diff --git a/gguf-llama.cpp b/gguf-llama.cpp index cf2c56955..defe26fe0 100644 --- a/gguf-llama.cpp +++ b/gguf-llama.cpp @@ -778,8 +778,7 @@ struct gguf_file_saver { } write_tensor_info(tensor); - // file.write_raw(new_data); - GGML_UNUSED(new_data); + file.write_raw(new_data, new_size); size_t padded_size = GGML_PAD(new_size, GGUF_DEFAULT_ALIGNMENT); // TODO: handle custom alignment size_t pad = padded_size - new_size; file.write_zeros(pad); diff --git a/gguf-util.h b/gguf-util.h index 0964e6d02..17f9dc968 100644 --- a/gguf-util.h +++ b/gguf-util.h @@ -123,6 +123,10 @@ struct gguf_file { return fwrite((const char *) &val, sizeof(val), 1, fp); } + void write_raw(const void * data, size_t size) { + fwrite(data, size, 1, fp); + } + template void write_val(const std::string & key, enum gguf_type type, const T & val) { write_str(key);