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
textstringThe text chunk. This should be a single word from the vocabulary, such as 'cat'.
biasfloatThe bias value, typically ranging from -5 to +5, smoothly adjusts the odds of a word appearing, either decreasing or increasing.
modeLogitBiasSetModeAn optional LogitBiasMode enumeration member specifying how to incorporate the bias value within the instance. The default value is LogitBiasMode.Replace.
ignoreCaseboolAn optional boolean that specifies whether case must be ignored. The default value is true.
disableTrimmingboolAn optional boolean that specifies whether trimming must be ignored. The default value is false.