Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

convert: capture `head_dim` for mistral (#5818)

Jeffrey Morgand835368eb859
diff --git a/convert/mistral.go b/convert/mistral.go
index da6874cfd..8fe066d6a 100644
--- a/convert/mistral.go
+++ b/convert/mistral.go
@@ -71,6 +71,11 @@ func (m *MistralModel) WriteGGUF(ws io.WriteSeeker) error {
"tokenizer.ggml.unknown_token_id": uint32(0),
}
+ if m.Params.HeadDimension > 0 {
+ kv["llama.attention.key_length"] = uint32(m.Params.HeadDimension)
+ kv["llama.attention.value_length"] = uint32(m.Params.HeadDimension)
+ }
+
return llm.NewGGUFV3(m.Params.ByteOrder).Encode(ws, kv, m.Tensors)
}