Skip to content

ISamplingPipelineExtensions

Namespace: LLama.Sampling

Extensions methods for ISamplingPipeline

1
public static class ISamplingPipelineExtensions

Inheritance ObjectISamplingPipelineExtensions

Methods

Sample(ISamplingPipeline, SafeLLamaContextHandle, Span<Single>, List<LLamaToken>)

Sample a single token from the given logits

1
public static LLamaToken Sample(ISamplingPipeline pipeline, SafeLLamaContextHandle ctx, Span<float> logits, List<LLamaToken> lastTokens)

Parameters

pipeline ISamplingPipeline

ctx SafeLLamaContextHandle
The context being sampled from

logits Span<Single>
The logits produced by the model

lastTokens List<LLamaToken>
A list of tokens recently returned by the model

Returns

LLamaToken