Table of Contents

Class AfterTokenSamplingEventArgs

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

Provides details for the event that occurs after a token sampling operation.

public sealed class AfterTokenSamplingEventArgs : EventArgs
Inheritance
AfterTokenSamplingEventArgs
Inherited Members

Properties

KeepLast

Determines whether the last generated token should be included in the response when the text completion process is terminated prematurely. This property is relevant only if Stop is set to true.

Model

Gets the Model instance associated with this object.

Stop

A flag indicating whether the text completion process should be terminated prematurely.

TextChunk

Gets the vocabulary entry associated with the specified Token.

Token

Specifies the identifier of the token selected for text completion, initially determined by the sampling engine but adjustable as needed.

TokenProbability

Gets the probability associated with the specified Token. The value is in the range [0; 1].
A higher value indicates a higher likelihood of occurrence.

Methods

GetTokenCandidateByRank(int)

Retrieves the identifier of a token based on its rank in terms of likelihood of occurrence.

GetTokenCandidateProbability(int)

Retrieves the probability of occurrence for a given token.
This method can be used to evaluate the likelihood of a particular token being the next token in a sequence, based on the current model's understanding and predictions.

GetTokenCandidateProbabilityByRank(int)

Retrieves the probability value of a token based on its rank in terms of likelihood of occurrence.

GetTokenCandidateTextChunkByRank(int)

Retrieves the text value of a token based on its rank in terms of likelihood of occurrence.