From 66ce19aecb711ad7fc994e083a02a6f773d095ee Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Tue, 15 Aug 2023 10:55:42 +0300 Subject: [PATCH] llama : fix quantization using gguf tool --- gguf-llama.cpp | 2 +- gguf-util.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gguf-llama.cpp b/gguf-llama.cpp index de937958b..5df684c19 100644 --- a/gguf-llama.cpp +++ b/gguf-llama.cpp @@ -730,7 +730,7 @@ struct gguf_file_saver { data[j] = val; } - file.write_arr(key, type, data); + file.write_arr(key, type, data); } void write_hparam_arr_f32(const std::string & key, enum gguf_type type, int i, int n_arr) { diff --git a/gguf-util.h b/gguf-util.h index b6a20cf5b..c22a14e9c 100644 --- a/gguf-util.h +++ b/gguf-util.h @@ -130,6 +130,7 @@ struct gguf_file { template void write_arr(const std::string & key, enum gguf_type type, const std::vector & val) { + static_assert(std::is_fundamental::value, "T must be a primitive type"); write_str(key); { const enum gguf_type tarr = GGUF_TYPE_ARRAY; @@ -151,7 +152,7 @@ struct gguf_file { fwrite(val.c_str(), n, 1, fp); } - void write_str(const std::string & key, enum gguf_type type, const std::vector & val) { + void write_arr(const std::string & key, enum gguf_type type, const std::vector & val) { write_str(key); { const enum gguf_type tarr = GGUF_TYPE_ARRAY;