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

13 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
}