using System;
using LLama.Native;
namespace LLama.Sampling.Tokens;
///
/// Sample with temperature.
/// As temperature increases, the prediction becomes more diverse but also vulnerable to hallucinations -- generating tokens that are sensible but not factual
///
public sealed class TemperatureSampling
: ITokenDataProcessor
{
///
/// Temperature value to apply
///
public float Temperature { get; set; } = 0.5f;
///
public void ProcessTokens(SafeLLamaContextHandle ctx, LLamaTokenDataArray tokens, ReadOnlySpan lastTokens)
{
tokens.Temperature(ctx, Temperature);
}
///
public void AcceptToken(SafeLLamaContextHandle ctx, int token)
{
}
///
public void Reset()
{
}
///
public void Dispose()
{
}
}