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