Table of Contents

Method GetTokenCandidateProbability

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

GetTokenCandidateProbability(int)

Retrieves the probability of a specified token by its token ID.

public float GetTokenCandidateProbability(int token)

Parameters

token int

The token identifier for which to get the probability. Must be within the range [0, Model.Vocabulary.Size - 1].

Returns

float

A float in the range [0, 1], representing the probability of the specified token.

Remarks

Use this method to inspect the likelihood of alternate token options and compare their probabilities to the chosen token.

Exceptions

ArgumentOutOfRangeException

Thrown if token is outside the valid token ID range.