BaseSamplingPipeline
Namespace: LLama.Sampling
Base class for implementing custom sampling pipelines. This provides a helpful framework for implementing ISamplingPipeline.
1 | |
Inheritance Object → BaseSamplingPipeline
Implements ISamplingPipeline, IDisposable
Properties
Grammar
Grammar to constrain valid tokens
1 | |
Property Value
Methods
Sample(SafeLLamaContextHandle, Span<Single>, ReadOnlySpan<LLamaToken>)
1 | |
Parameters
logits Span<Single>
lastTokens ReadOnlySpan<LLamaToken>
Returns
Accept(SafeLLamaContextHandle, LLamaToken)
1 | |
Parameters
token LLamaToken
ProcessLogits(SafeLLamaContextHandle, Span<Single>, ReadOnlySpan<LLamaToken>)
Process the raw logit values
1 | |
Parameters
ctx SafeLLamaContextHandle
The context being sampled from
logits Span<Single>
The logits produced by the model
lastTokens ReadOnlySpan<LLamaToken>
A list of tokens recently returned by the model
ProcessTokenDataArray(SafeLLamaContextHandle, LLamaTokenDataArray, ReadOnlySpan<LLamaToken>)
Process the LLamaTokenDataArray and select a single token
1 | |
Parameters
ctx SafeLLamaContextHandle
The context being sampled from
candidates LLamaTokenDataArray
The LLamaTokenDataArray data produced by the model
lastTokens ReadOnlySpan<LLamaToken>
A list of tokens recently returned by the model
Returns
Reset()
1 | |
Clone()
1 | |
Returns
Dispose()
1 | |