Class RepetitionPenaltyConfig
public sealed class RepetitionPenaltyConfig : LiteRTLMNativeHandle
- Inheritance
-
objectRepetitionPenaltyConfig
- 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
frequencyPenaltyfloatA 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
presencePenaltyfloatA 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
repetitionPenaltyfloatA multiplicative penalty for any token already generated.
SetWindowSize(int)
Sets the window size for the repetition penalty config.
public void SetWindowSize(int windowSize)
Parameters
windowSizeintThe maximum number of recent tokens to consider.