Skip to content

GreedySamplingPipeline

Namespace: LLama.Sampling

A sampling pipeline which always selects the most likely token

1
public class GreedySamplingPipeline : BaseSamplingPipeline, ISamplingPipeline, System.IDisposable

Inheritance ObjectBaseSamplingPipelineGreedySamplingPipeline
Implements ISamplingPipeline, IDisposable

Properties

Grammar

Grammar to constrain valid tokens

1
public SafeLLamaGrammarHandle Grammar { get; set; }

Property Value

SafeLLamaGrammarHandle

Constructors

GreedySamplingPipeline()

1
public GreedySamplingPipeline()

Methods

ProcessLogits(SafeLLamaContextHandle, Span<Single>, ReadOnlySpan<LLamaToken>)

1
protected void ProcessLogits(SafeLLamaContextHandle ctx, Span<float> logits, ReadOnlySpan<LLamaToken> lastTokens)

Parameters

ctx SafeLLamaContextHandle

logits Span<Single>

lastTokens ReadOnlySpan<LLamaToken>

ProcessTokenDataArray(SafeLLamaContextHandle, LLamaTokenDataArray, ReadOnlySpan<LLamaToken>)

1
protected LLamaToken ProcessTokenDataArray(SafeLLamaContextHandle ctx, LLamaTokenDataArray candidates, ReadOnlySpan<LLamaToken> lastTokens)

Parameters

ctx SafeLLamaContextHandle

candidates LLamaTokenDataArray

lastTokens ReadOnlySpan<LLamaToken>

Returns

LLamaToken

Clone()

1
public ISamplingPipeline Clone()

Returns

ISamplingPipeline