Skip to content

MirostateSamplingPipeline

Namespace: LLama.Sampling

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

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

Inheritance ObjectBaseSamplingPipelineMirostateSamplingPipeline
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

MirostateSamplingPipeline()

1
public MirostateSamplingPipeline()

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