sample

package
v0.18.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sampler

type Sampler struct {
	Temperature     float32
	TopP            float32
	MinP            float32
	TopK            int
	RepeatLastN     int
	PresencePenalty float32
	// contains filtered or unexported fields
}

func New

func New(temp, top_p, min_p float32, top_k, repeatLastN int, presencePenalty float32) *Sampler

func (*Sampler) AppendToken

func (s *Sampler) AppendToken(token *mlx.Array)

func (*Sampler) Free

func (s *Sampler) Free()

func (*Sampler) ResetHistory

func (s *Sampler) ResetHistory(history []int32)

func (*Sampler) Sample

func (s *Sampler) Sample(logits *mlx.Array) *mlx.Array

type Transform

type Transform func(*Sampler, *mlx.Array) *mlx.Array

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL