Table of Contents

Class SamplerParams

public sealed class SamplerParams : LiteRTLMNativeHandle
Inheritance
object
SamplerParams
Inherited Members

Constructors

SamplerParams(SamplerType)

Creates a managed wrapper around LiteRT LM sampler parameters for a specific sampler type. The caller is responsible for disposing the wrapper using Dispose().

public SamplerParams(SamplerType samplerType)

Parameters

samplerType SamplerType

The sampler type to use.

Exceptions

InvalidOperationException

Thrown if the native object could not be created.

Methods

ReleaseUnmanagedResources()

protected override void ReleaseUnmanagedResources()

SetSeed(int)

Sets the seed.

public void SetSeed(int seed)

Parameters

seed int

SetTemperature(float)

Sets the temperature.

public void SetTemperature(float temperature)

Parameters

temperature float

SetTopK(int)

Sets the top-k value.

public void SetTopK(int topK)

Parameters

topK int

SetTopP(float)

Sets the top-p value.

public void SetTopP(float topP)

Parameters

topP float