LLamaSharp/docs/xmldocs/llama.sampling.greedysampli...

2.2 KiB

GreedySamplingPipeline

Namespace: LLama.Sampling

A sampling pipeline which always selects the most likely token

public class GreedySamplingPipeline : BaseSamplingPipeline, ISamplingPipeline, System.IDisposable

Inheritance ObjectBaseSamplingPipelineGreedySamplingPipeline
Implements ISamplingPipeline, IDisposable

Properties

Grammar

Grammar to constrain valid tokens

public SafeLLamaGrammarHandle Grammar { get; set; }

Property Value

SafeLLamaGrammarHandle

Constructors

GreedySamplingPipeline()

public GreedySamplingPipeline()

Methods

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

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>)

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

Parameters

ctx SafeLLamaContextHandle

candidates LLamaTokenDataArray

lastTokens ReadOnlySpan<LLamaToken>

Returns

LLamaToken

Clone()

public ISamplingPipeline Clone()

Returns

ISamplingPipeline