Method GetTokenCandidateByRank
- Namespace
- LMKit.TextGeneration.Events
- Assembly
- LM-Kit.NET.dll
GetTokenCandidateByRank(int)
Retrieves the token ID of a candidate token based on its rank order in terms of likelihood.
public int GetTokenCandidateByRank(int rankIndex)
Parameters
rankIndex
intThe rank index of the candidate token. Must be within [0, number_of_tokens - 1], where 0 is the most likely token.
Returns
- int
The token ID of the candidate token at the specified rank.
Remarks
Use this method to explore alternative token candidates beyond the top choice and understand the model's next best guesses.
Exceptions
- ArgumentOutOfRangeException
Thrown if
rankIndex
is outside the valid range.