Table of Contents

Class RepetitionPenaltyConfig

public sealed class RepetitionPenaltyConfig : LiteRTLMNativeHandle
Inheritance
object
RepetitionPenaltyConfig
Inherited Members

Constructors

RepetitionPenaltyConfig()

Creates a managed wrapper around a LiteRT LM repetition penalty configuration. The caller is responsible for disposing the wrapper using Dispose().

public RepetitionPenaltyConfig()

Exceptions

InvalidOperationException

Thrown if the native object could not be created.

Methods

ReleaseUnmanagedResources()

protected override void ReleaseUnmanagedResources()

SetFrequencyPenalty(float)

public void SetFrequencyPenalty(float frequencyPenalty)

Parameters

frequencyPenalty float

A scalar subtracted from a token's logit scaled by previous appearances.

SetPresencePenalty(float)

Sets the presence penalty for the repetition penalty config.

public void SetPresencePenalty(float presencePenalty)

Parameters

presencePenalty float

A scalar subtracted from a logit if a token has appeared at least once.

SetRepetitionPenalty(float)

Sets the repetition penalty for the repetition penalty config.

public void SetRepetitionPenalty(float repetitionPenalty)

Parameters

repetitionPenalty float

A multiplicative penalty for any token already generated.

SetWindowSize(int)

Sets the window size for the repetition penalty config.

public void SetWindowSize(int windowSize)

Parameters

windowSize int

The maximum number of recent tokens to consider.