]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
quantize : change int to unsigned int for KV overrides (#14197)
authorEd Addario <redacted>
Sun, 15 Jun 2025 16:53:45 +0000 (17:53 +0100)
committerGitHub <redacted>
Sun, 15 Jun 2025 16:53:45 +0000 (18:53 +0200)
src/llama-quant.cpp

index 159b1307a4c5d70ba49d476743350feaf0f7a231..8cf45732fd6d4817cdafd6fd3de6c2bea421fec4 100644 (file)
@@ -585,7 +585,8 @@ static void llama_model_quantize_impl(const std::string & fname_inp, const std::
             if (o.tag == LLAMA_KV_OVERRIDE_TYPE_FLOAT) {
                 gguf_set_val_f32(ctx_out.get(), o.key, o.val_f64);
             } else if (o.tag == LLAMA_KV_OVERRIDE_TYPE_INT) {
-                gguf_set_val_i32(ctx_out.get(), o.key, o.val_i64);
+                // Setting type to UINT32. See https://github.com/ggml-org/llama.cpp/pull/14182 for context
+                gguf_set_val_u32(ctx_out.get(), o.key, (uint32_t)abs(o.val_i64));
             } else if (o.tag == LLAMA_KV_OVERRIDE_TYPE_BOOL) {
                 gguf_set_val_bool(ctx_out.get(), o.key, o.val_bool);
             } else if (o.tag == LLAMA_KV_OVERRIDE_TYPE_STR) {