ollama/ml/nn/embedding.go
Michael Yang 8cb7b94c40 next ollama runner
implement llama and mllama model architectures in go using ggml (through
cgo)
2025-01-20 09:39:43 -08:00

11 lines
232 B
Go

package nn
import "github.com/ollama/ollama/ml"
type Embedding struct {
Weight ml.Tensor `gguf:"weight"`
}
func (m *Embedding) Forward(ctx ml.Context, hiddenState ml.Tensor) ml.Tensor {
return m.Weight.Rows(ctx, hiddenState)
}