ollama/ml/nn/embedding.go
Michael Yang 8ab13e4d3e next
2025-01-22 22:10:31 -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)
}