llama : fix quantization using gguf tool
This commit is contained in:
parent
a82e3a4d92
commit
66ce19aecb
2 changed files with 3 additions and 2 deletions
|
@ -730,7 +730,7 @@ struct gguf_file_saver {
|
||||||
data[j] = val;
|
data[j] = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
file.write_arr<std::string>(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) {
|
void write_hparam_arr_f32(const std::string & key, enum gguf_type type, int i, int n_arr) {
|
||||||
|
|
|
@ -130,6 +130,7 @@ struct gguf_file {
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void write_arr(const std::string & key, enum gguf_type type, const std::vector<T> & val) {
|
void write_arr(const std::string & key, enum gguf_type type, const std::vector<T> & val) {
|
||||||
|
static_assert(std::is_fundamental<T>::value, "T must be a primitive type");
|
||||||
write_str(key);
|
write_str(key);
|
||||||
{
|
{
|
||||||
const enum gguf_type tarr = GGUF_TYPE_ARRAY;
|
const enum gguf_type tarr = GGUF_TYPE_ARRAY;
|
||||||
|
@ -151,7 +152,7 @@ struct gguf_file {
|
||||||
fwrite(val.c_str(), n, 1, fp);
|
fwrite(val.c_str(), n, 1, fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void write_str(const std::string & key, enum gguf_type type, const std::vector<std::string> & val) {
|
void write_arr(const std::string & key, enum gguf_type type, const std::vector<std::string> & val) {
|
||||||
write_str(key);
|
write_str(key);
|
||||||
{
|
{
|
||||||
const enum gguf_type tarr = GGUF_TYPE_ARRAY;
|
const enum gguf_type tarr = GGUF_TYPE_ARRAY;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue