class

Llama::Sampler::Temp

Inherits Llama::Sampler::Base / Reference / Object

Temperature sampler

The Temperature sampler adjusts the logits by dividing them by the temperature value. Higher temperatures (>1.0) make the distribution more uniform, leading to more random outputs. Lower temperatures (<1.0) make the distribution more peaked, leading to more deterministic outputs.

Example:

sampler = Llama::Sampler::Temp.new(0.8) # Slightly more deterministic than default

Constructors

new(temp : Float32)

Creates a new temperature sampler

Parameters:

  • temp: The temperature value (0.0 = greedy, 1.0 = normal, >1.0 = more random)

Raises:

  • Llama::Error if the sampler cannot be created
Source