GreedySamplingPipeline
Namespace: LLama.Sampling
A sampling pipeline which always selects the most likely token
public class GreedySamplingPipeline : BaseSamplingPipeline, ISamplingPipeline, System.IDisposable
Inheritance Object → BaseSamplingPipeline → GreedySamplingPipeline
Implements ISamplingPipeline, IDisposable
Properties
Grammar
Grammar to constrain valid tokens
public SafeLLamaGrammarHandle Grammar { get; set; }
Property Value
Constructors
GreedySamplingPipeline()
public GreedySamplingPipeline()
Methods
ProcessLogits(SafeLLamaContextHandle, Span<Single>, ReadOnlySpan<LLamaToken>)
protected void ProcessLogits(SafeLLamaContextHandle ctx, Span<float> logits, ReadOnlySpan<LLamaToken> lastTokens)
Parameters
logits
Span<Single>
lastTokens
ReadOnlySpan<LLamaToken>
ProcessTokenDataArray(SafeLLamaContextHandle, LLamaTokenDataArray, ReadOnlySpan<LLamaToken>)
protected LLamaToken ProcessTokenDataArray(SafeLLamaContextHandle ctx, LLamaTokenDataArray candidates, ReadOnlySpan<LLamaToken> lastTokens)
Parameters
candidates
LLamaTokenDataArray
lastTokens
ReadOnlySpan<LLamaToken>
Returns
Clone()
public ISamplingPipeline Clone()