class Llama::Sampler::AdaptiveP

Overview

Adaptive-P sampler

Selects tokens near a configurable target probability over time.

Defined in:

llama/sampler/adaptive_p.cr

Constructors

Instance methods inherited from class Llama::Sampler::Base

to_unsafe : Pointer(Llama::LibLlama::LlamaSampler) to_unsafe

Constructor methods inherited from class Llama::Sampler::Base

new(handle : Pointer(LibLlama::LlamaSampler)) new

Constructor Detail

def self.new(target : Float32, decay : Float32, seed : UInt32 = LibLlama::LLAMA_DEFAULT_SEED) #

Creates a new Adaptive-P sampler.

Parameters:

  • target: Target probability (0.0 to 1.0, negative to disable)
  • decay: EMA decay (0.0 to 0.99)
  • seed: RNG seed

Raises:

  • Llama::Error if the sampler cannot be created

[View source]