sample

package
v0.0.0-...-e1ffba4 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrammarSampler

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

func NewGrammarSampler

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

func (*GrammarSampler) Accept

func (g *GrammarSampler) Accept(token int32)

func (*GrammarSampler) Apply

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

func (*GrammarSampler) Free

func (g *GrammarSampler) Free()

type Sampler

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

func NewSampler

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/CopperCarbonateCollective/ollama-DreamingMetal/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