sample

package
v0.7.0-rc0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrammarSampler added in v0.6.7

type GrammarSampler struct {
	// contains filtered or unexported fields
}

func NewGrammarSampler added in v0.6.7

func NewGrammarSampler(model model.TextProcessor, grammarStr string) (*GrammarSampler, error)

func (*GrammarSampler) Accept added in v0.6.7

func (g *GrammarSampler) Accept(token int32)

func (*GrammarSampler) Apply added in v0.6.7

func (g *GrammarSampler) Apply(tokens []token)

func (*GrammarSampler) Free added in v0.6.7

func (g *GrammarSampler) Free()

type Sampler

type Sampler struct {
	// contains filtered or unexported fields
}

func NewSampler added in v0.5.13

func NewSampler(temperature float32, topK int, topP float32, minP float32, seed int, grammar *GrammarSampler) Sampler

TODO(parthsareen): update sampler interface to use json unmarshal https://github.com/ollama/ollama/issues/9278

func (*Sampler) Sample

func (s *Sampler) Sample(logits []float32) (int32, error)

Jump to

Keyboard shortcuts

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