ollama/sample/greedy.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

14 lines
227 B
Go

package sample
import "gonum.org/v1/gonum/floats"
type greedy struct{}
func Greedy() Sampler {
return greedy{}
}
func (s greedy) Sample(t []float64) ([]float64, error) {
return []float64{float64(floats.MaxIdx(t))}, nil
}