convert: capture head_dim for mistral (#5818)

This commit is contained in:
Jeffrey Morgan 2024-07-22 16:16:22 -04:00 committed by GitHub
parent 5784c05397
commit d835368eb8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
}