gemma3: make embedding non-causal (#12297)

This commit is contained in:
Michael Yang
2025-10-27 19:54:08 -07:00
committed by GitHub
parent 5d347f6d6f
commit ec9eb28f4c
2 changed files with 11 additions and 15 deletions

View File

@@ -2,7 +2,6 @@ package gemma3
import (
"github.com/ollama/ollama/fs"
"github.com/ollama/ollama/kvcache"
"github.com/ollama/ollama/ml"
"github.com/ollama/ollama/ml/nn"
"github.com/ollama/ollama/ml/nn/pooling"
@@ -53,10 +52,5 @@ func newEmbedModel(c fs.Config) (model.Model, error) {
poolingType: pooling.Type(c.Uint("pooling_type", 0)),
}
m.Cache = kvcache.NewWrapperCache(
kvcache.NewSWACache(int32(c.Uint("attention.sliding_window")), m.Shift),
kvcache.NewCausalCache(m.Shift),
)
return m, nil
}