Files
ollama/ml/nn/embedding.go
Michael Yang 2c5fb24855 wip: next ollama runner
implement llama and mllama model architectures in go using ggml (through
cgo)
2024-12-11 10:22:38 -08:00

12 lines
232 B
Go

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