"vscode:/vscode.git/clone" did not exist on "c864c91065abcd71b4610a9803fc68e1be8b11d2"
Unverified Commit 4f895d63 authored by Michael Yang's avatar Michael Yang Committed by GitHub
Browse files

Merge pull request #3466 from ollama/mxyng/head-kv

default head_kv to 1
parents 7d05a6ee 90f071c6
...@@ -148,15 +148,15 @@ func (kv KV) HeadCount() uint64 { ...@@ -148,15 +148,15 @@ func (kv KV) HeadCount() uint64 {
} }
func (kv KV) HeadCountKV() uint64 { func (kv KV) HeadCountKV() uint64 {
return kv.u64(fmt.Sprintf("%s.attention.head_count_kv", kv.Architecture())) if headCountKV := kv.u64(fmt.Sprintf("%s.attention.head_count_kv", kv.Architecture())); headCountKV > 0 {
return headCountKV
}
return 1
} }
func (kv KV) GQA() uint64 { func (kv KV) GQA() uint64 {
if headCountKV := kv.HeadCountKV(); headCountKV > 0 { return kv.HeadCount() / kv.HeadCountKV()
return kv.HeadCount() / headCountKV
}
return 0
} }
func (kv KV) EmbeddingLength() uint64 { func (kv KV) EmbeddingLength() uint64 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment