ISamplingPipeline
Namespace: LLama.Sampling
Convert a span of logits into a single sampled token. This interface can be implemented to completely customise the sampling process.
1 |
|
Implements IDisposable
Methods
Sample(SafeLLamaContextHandle, Span<Single>, ReadOnlySpan<LLamaToken>)
Sample a single token from the given logits
1 |
|
Parameters
ctx
SafeLLamaContextHandle
The context being sampled from
logits
Span<Single>
The logits produced by the model
lastTokens
ReadOnlySpan<LLamaToken>
A span of tokens recently returned by the model
Returns
Accept(SafeLLamaContextHandle, LLamaToken)
Update the pipeline, with knowledge that a particular token was just accepted
1 |
|
Parameters
token
LLamaToken
Reset()
Reset all internal state of the sampling pipeline
1 |
|
Clone()
Create a copy of this sampling pipeline
1 |
|