Table of Contents

Method AddTextChunkBias

Namespace
LMKit.TextGeneration.Sampling
Assembly
LM-Kit.NET.dll

AddTextChunkBias(string, float, LogitBiasSetMode, bool, bool)

Introduces a bias in the probability of appearance for a specific text chunk, influencing its likelihood of being included during the sampling process associated with this LogitBias instance.

public void AddTextChunkBias(string text, float bias, LogitBiasSetMode mode = LogitBiasSetMode.Replace, bool ignoreCase = true, bool disableTrimming = false)

Parameters

text string

The text chunk. This should be a single word from the vocabulary, such as 'cat'.

bias float

The bias value, typically ranging from -5 to +5, smoothly adjusts the odds of a word appearing, either decreasing or increasing.

mode LogitBiasSetMode

An optional LogitBiasMode enumeration member specifying how to incorporate the bias value within the instance. The default value is LogitBiasMode.Replace.

ignoreCase bool

An optional boolean that specifies whether case must be ignored. The default value is true.

disableTrimming bool

An optional boolean that specifies whether trimming must be ignored. The default value is false.