class Llama::Sampler::Infill

Overview

Infill sampler

The Infill sampler is designed for fill-in-the-middle (FIM) tasks. It helps to generate text that fits naturally between existing content.

Example:

sampler = Llama::Sampler::Infill.new(model.vocab)

Defined in:

llama/sampler/infill.cr

Constructors

Instance Method Summary

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(vocab : Vocab) #

Creates a new Infill sampler

Parameters:

  • vocab: The vocabulary to use

Raises:

  • Llama::Error if the sampler cannot be created

[View source]

Instance Method Detail

def finalize #

Overrides the parent class's finalize method to ensure proper cleanup


[View source]