LLamaSharp/docs/xmldocs/llama.sampling.mirostatesam...

2.8 KiB

MirostateSamplingPipeline

Namespace: LLama.Sampling

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

public class MirostateSamplingPipeline : BaseSamplingPipeline, ISamplingPipeline, System.IDisposable

Inheritance ObjectBaseSamplingPipelineMirostateSamplingPipeline
Implements ISamplingPipeline, IDisposable

Properties

Mu

Currently learned mu value

public float Mu { get; }

Property Value

Single

Tau

target entropy

public float Tau { get; set; }

Property Value

Single

Eta

learning rate

public float Eta { get; set; }

Property Value

Single

Grammar

Grammar to constrain valid tokens

public SafeLLamaGrammarHandle Grammar { get; set; }

Property Value

SafeLLamaGrammarHandle

Constructors

MirostateSamplingPipeline()

public MirostateSamplingPipeline()

Methods

ProcessLogits(SafeLLamaContextHandle, Span<Single>, ReadOnlySpan<LLamaToken>)

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>)

protected LLamaToken ProcessTokenDataArray(SafeLLamaContextHandle ctx, LLamaTokenDataArray candidates, ReadOnlySpan<LLamaToken> lastTokens)

Parameters

ctx SafeLLamaContextHandle

candidates LLamaTokenDataArray

lastTokens ReadOnlySpan<LLamaToken>

Returns

LLamaToken

Reset()

public void Reset()

Clone()

public ISamplingPipeline Clone()

Returns

ISamplingPipeline