mirror of
https://github.com/ollama/ollama.git
synced 2025-04-21 22:15:04 +02:00
14 lines
227 B
Go
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
|
|
}
|