Skip to content

Commit 30e5b01

Browse files
authored
quantize : change int to unsigned int for KV overrides (#14197)
1 parent e54b394 commit 30e5b01

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/llama-quant.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,8 @@ static void llama_model_quantize_impl(const std::string & fname_inp, const std::
585585
if (o.tag == LLAMA_KV_OVERRIDE_TYPE_FLOAT) {
586586
gguf_set_val_f32(ctx_out.get(), o.key, o.val_f64);
587587
} else if (o.tag == LLAMA_KV_OVERRIDE_TYPE_INT) {
588-
gguf_set_val_i32(ctx_out.get(), o.key, o.val_i64);
588+
// Setting type to UINT32. See https://github.com/ggml-org/llama.cpp/pull/14182 for context
589+
gguf_set_val_u32(ctx_out.get(), o.key, (uint32_t)abs(o.val_i64));
589590
} else if (o.tag == LLAMA_KV_OVERRIDE_TYPE_BOOL) {
590591
gguf_set_val_bool(ctx_out.get(), o.key, o.val_bool);
591592
} else if (o.tag == LLAMA_KV_OVERRIDE_TYPE_STR) {

0 commit comments

Comments
 (0)