Skip to content

InferenceParams

Namespace: LLama.Common

The parameters used for inference.

1
public class InferenceParams : LLama.Abstractions.IInferenceParams, System.IEquatable`1[[LLama.Common.InferenceParams, LLamaSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]

Inheritance ObjectInferenceParams
Implements IInferenceParams, IEquatable<InferenceParams>

Properties

TokensKeep

number of tokens to keep from initial prompt

1
public int TokensKeep { get; set; }

Property Value

Int32

MaxTokens

how many new tokens to predict (n_predict), set to -1 to inifinitely generate response until it complete.

1
public int MaxTokens { get; set; }

Property Value

Int32

LogitBias

logit bias for specific tokens

1
public Dictionary<LLamaToken, float> LogitBias { get; set; }

Property Value

Dictionary<LLamaToken, Single>

AntiPrompts

Sequences where the model will stop generating further tokens.

1
public IReadOnlyList<string> AntiPrompts { get; set; }

Property Value

IReadOnlyList<String>

TopK

1
public int TopK { get; set; }

Property Value

Int32

TopP

1
public float TopP { get; set; }

Property Value

Single

MinP

1
public float MinP { get; set; }

Property Value

Single

TfsZ

1
public float TfsZ { get; set; }

Property Value

Single

TypicalP

1
public float TypicalP { get; set; }

Property Value

Single

Temperature

1
public float Temperature { get; set; }

Property Value

Single

RepeatPenalty

1
public float RepeatPenalty { get; set; }

Property Value

Single

RepeatLastTokensCount

1
public int RepeatLastTokensCount { get; set; }

Property Value

Int32

FrequencyPenalty

1
public float FrequencyPenalty { get; set; }

Property Value

Single

PresencePenalty

1
public float PresencePenalty { get; set; }

Property Value

Single

Mirostat

1
public MirostatType Mirostat { get; set; }

Property Value

MirostatType

MirostatTau

1
public float MirostatTau { get; set; }

Property Value

Single

MirostatEta

1
public float MirostatEta { get; set; }

Property Value

Single

PenalizeNL

1
public bool PenalizeNL { get; set; }

Property Value

Boolean

Grammar

1
public SafeLLamaGrammarHandle Grammar { get; set; }

Property Value

SafeLLamaGrammarHandle

SamplingPipeline

1
public ISamplingPipeline SamplingPipeline { get; set; }

Property Value

ISamplingPipeline

Constructors

InferenceParams()

1
public InferenceParams()

Methods

ToString()

1
public string ToString()

Returns

String

PrintMembers(StringBuilder)

1
protected bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

Boolean

GetHashCode()

1
public int GetHashCode()

Returns

Int32

Equals(Object)

1
public bool Equals(object obj)

Parameters

obj Object

Returns

Boolean

Equals(InferenceParams)

1
public bool Equals(InferenceParams other)

Parameters

other InferenceParams

Returns

Boolean

<Clone>$()

1
public InferenceParams <Clone>$()

Returns

InferenceParams