abstract class
Llama::Sampler::Base
- Llama::Sampler::Base
- Reference
- Object
Overview
Base class for all sampling methods. Sampling is the process of selecting the next token during text generation. This is an abstract class.
Direct Known Subclasses
- Llama::Sampler::Dist
- Llama::Sampler::Grammar
- Llama::Sampler::GrammarLazyPatterns
- Llama::Sampler::Greedy
- Llama::Sampler::Infill
- Llama::Sampler::MinP
- Llama::Sampler::Mirostat
- Llama::Sampler::MirostatV2
- Llama::Sampler::Penalties
- Llama::Sampler::Temp
- Llama::Sampler::TempExt
- Llama::Sampler::TopK
- Llama::Sampler::TopNSigma
- Llama::Sampler::TopP
- Llama::Sampler::Typical
- Llama::Sampler::Xtc
Defined in:
llama/sampler/base.crConstructors
-
.new(handle : Pointer(LibLlama::LlamaSampler))
Creates a new Sampler instance from a raw pointer.
Instance Method Summary
-
#to_unsafe : Pointer(Llama::LibLlama::LlamaSampler)
Returns the raw pointer to the underlying llama_sampler structure.
Constructor Detail
def self.new(handle : Pointer(LibLlama::LlamaSampler))
#
Creates a new Sampler instance from a raw pointer.
Note: This constructor is intended for internal use.
Instance Method Detail
def to_unsafe : Pointer(Llama::LibLlama::LlamaSampler)
#
Returns the raw pointer to the underlying llama_sampler structure.