Skip to content

Commit

Permalink
convert: capture head_dim for mistral (ollama#5818)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmorganca authored Jul 22, 2024
1 parent 5784c05 commit d835368
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions convert/mistral.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit d835368

Please sign in to comment.