]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
model : make minicpm embedding_scale, residual_scale and logit_scale optional with...
authorVinkal <redacted>
Fri, 26 Sep 2025 21:28:29 +0000 (02:58 +0530)
committerGitHub <redacted>
Fri, 26 Sep 2025 21:28:29 +0000 (23:28 +0200)
commit72b24d96c6888c609d562779a23787304ae4609c
treeffdcc241f1a9a6e8218df463383fb10afd68c443
parent624207e676ab5eb3ce7af631902bb45fb73a8359
model : make minicpm embedding_scale, residual_scale and logit_scale optional with legacy defaults (#16273)

* minicpm: make GGUF scaling keys optional with legacy defaults

Older MiniCPM GGUFs do not include the scaling metadata keys (minicpm.embedding_scale, minicpm.residual_scale, minicpm.logit_scale). The loader currently treats these as required, so quantization fails with:

    key not found in model: minicpm.embedding_scale

This change restores backward compatibility by treating these keys as optional in the loader and using the older MiniCPM scaling values:

    embedding_scale = 12.0f
    residual_scale  = 1.4f / sqrt(n_layer)
    logit_scale     = 256.0f / n_embd

When the GGUF provides the keys, their values override the defaults; otherwise the legacy defaults are used. Newer GGUFs that already include these keys are unaffected.

Fixes: #16192
Signed-off-by: Vinkal Chudgar <redacted>
* Update src/llama-model.cpp

Committed as suggested. Thanks!

Co-authored-by: Sigbjørn Skjæret <redacted>
---------

Signed-off-by: Vinkal Chudgar <redacted>
Co-authored-by: Sigbjørn Skjæret <redacted>
src/llama-model.cpp