mirror of
https://github.com/ollama/ollama.git
synced 2025-04-01 16:38:50 +02:00
default head_kv to 1
This commit is contained in:
parent
a039e383cd
commit
90f071c658
12
llm/ggml.go
12
llm/ggml.go
@ -148,15 +148,15 @@ func (kv KV) HeadCount() 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 {
|
||||
if headCountKV := kv.HeadCountKV(); headCountKV > 0 {
|
||||
return kv.HeadCount() / headCountKV
|
||||
}
|
||||
|
||||
return 0
|
||||
return kv.HeadCount() / kv.HeadCountKV()
|
||||
}
|
||||
|
||||
func (kv KV) EmbeddingLength() uint64 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user