Skip to content

Commit 5714599

Browse files
committed
llama : fix quantization using gguf tool
1 parent afaba33 commit 5714599

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

gguf-llama.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ struct gguf_file_saver {
729729
data[j] = val;
730730
}
731731

732-
file.write_arr<std::string>(key, type, data);
732+
file.write_arr(key, type, data);
733733
}
734734

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

gguf-util.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ struct gguf_file {
130130

131131
template<typename T>
132132
void write_arr(const std::string & key, enum gguf_type type, const std::vector<T> & val) {
133+
static_assert(std::is_fundamental<T>::value, "T must be a primitive type");
133134
write_str(key);
134135
{
135136
const enum gguf_type tarr = GGUF_TYPE_ARRAY;
@@ -151,7 +152,7 @@ struct gguf_file {
151152
fwrite(val.c_str(), n, 1, fp);
152153
}
153154

154-
void write_str(const std::string & key, enum gguf_type type, const std::vector<std::string> & val) {
155+
void write_arr(const std::string & key, enum gguf_type type, const std::vector<std::string> & val) {
155156
write_str(key);
156157
{
157158
const enum gguf_type tarr = GGUF_TYPE_ARRAY;

0 commit comments

Comments
 (0)