Skip to content

Mirostate2SamplingPipeline

Namespace: LLama.Sampling

A sampling pipeline which uses mirostat (v2) to select tokens

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

Inheritance ObjectBaseSamplingPipelineMirostate2SamplingPipeline
Implements ISamplingPipeline, IDisposable

Properties

Mu

Currently learned mu value

1
public float Mu { get; }

Property Value

Single

Tau

target entropy

1
public float Tau { get; set; }

Property Value

Single

Eta

learning rate

1
public float Eta { get; set; }

Property Value

Single

Grammar

Grammar to constrain valid tokens

1
public SafeLLamaGrammarHandle Grammar { get; set; }

Property Value

SafeLLamaGrammarHandle

Constructors

Mirostate2SamplingPipeline()

1
public Mirostate2SamplingPipeline()

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

Reset()

1
public void Reset()

Clone()

1
public ISamplingPipeline Clone()

Returns

ISamplingPipeline