Namespace: LLama.Abstractions
The paramters used for inference.
public interface IInferenceParams
number of tokens to keep from initial prompt
public abstract int TokensKeep { get; set; }
how many new tokens to predict (n_predict), set to -1 to inifinitely generate response
until it complete.
public abstract int MaxTokens { get; set; }
logit bias for specific tokens
public abstract Dictionary<LLamaToken, float> LogitBias { get; set; }
Dictionary<LLamaToken, Single>
Sequences where the model will stop generating further tokens.
public abstract IReadOnlyList<string> AntiPrompts { get; set; }
0 or lower to use vocab size
public abstract int TopK { get; set; }
1.0 = disabled
public abstract float TopP { get; set; }
0.0 = disabled
public abstract float MinP { get; set; }
1.0 = disabled
public abstract float TfsZ { get; set; }
1.0 = disabled
public abstract float TypicalP { get; set; }
1.0 = disabled
public abstract float Temperature { get; set; }
1.0 = disabled
public abstract float RepeatPenalty { get; set; }
last n tokens to penalize (0 = disable penalty, -1 = context size) (repeat_last_n)
public abstract int RepeatLastTokensCount { get; set; }
frequency penalty coefficient
0.0 = disabled
public abstract float FrequencyPenalty { get; set; }
presence penalty coefficient
0.0 = disabled
public abstract float PresencePenalty { get; set; }
Mirostat uses tokens instead of words.
algorithm described in the paper https://arxiv.org/abs/2007.14966.
0 = disabled, 1 = mirostat, 2 = mirostat 2.0
public abstract MirostatType Mirostat { get; set; }
target entropy
public abstract float MirostatTau { get; set; }
learning rate
public abstract float MirostatEta { get; set; }
consider newlines as a repeatable token (penalize_nl)
public abstract bool PenalizeNL { get; set; }
Grammar to constrain possible tokens
public abstract SafeLLamaGrammarHandle Grammar { get; set; }
Set a custom sampling pipeline to use. If this is set All other sampling parameters are ignored!
public abstract ISamplingPipeline SamplingPipeline { get; set; }