Llama::Sampler::TopK
Inherits Llama::Sampler::Base / Reference / Object
Top-K sampler
The Top-K sampler keeps only the K most likely tokens and zeros out the rest. This is a simple but effective way to filter out unlikely tokens.
Example:
sampler = Llama::Sampler::TopK.new(40) # Keep only the top 40 tokens