class Llama::Sampler::Xtc

Overview

XTC sampler

The XTC sampler combines aspects of several sampling methods for improved text generation quality. It was introduced in the Text Generation WebUI project.

Example:

sampler = Llama::Sampler::Xtc.new(0.3, 0.8, 1, 42)

Defined in:

llama/sampler/xtc.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(p : Float32, t : Float32, min_keep : Int32, seed : UInt32 = LibLlama::LLAMA_DEFAULT_SEED) #

Creates a new XTC sampler

Parameters:

  • p: Probability threshold
  • t: Temperature value
  • min_keep: Minimum number of tokens to keep
  • seed: Random seed for sampling

Raises:

  • Llama::Error if the sampler cannot be created

[View source]