Skip to content

< Back


BaseSamplingPipeline

Namespace: LLama.Sampling

1
public abstract class BaseSamplingPipeline : ISamplingPipeline, System.IDisposable

Inheritance ObjectBaseSamplingPipeline
Implements ISamplingPipeline, IDisposable
Attributes NullableContextAttribute, NullableAttribute

Constructors

BaseSamplingPipeline()

Create a new sampler wrapping a llama.cpp sampler chain

1
public BaseSamplingPipeline()

Methods

CreateChain(SafeLLamaContextHandle)

Create a sampling chain. This will be called once, the base class will automatically dispose the chain.

1
protected abstract SafeLLamaSamplerChainHandle CreateChain(SafeLLamaContextHandle context)

Parameters

context SafeLLamaContextHandle

Returns

SafeLLamaSamplerChainHandle

Dispose()

1
public void Dispose()

Sample(SafeLLamaContextHandle, Int32)

1
public LLamaToken Sample(SafeLLamaContextHandle ctx, int index)

Parameters

ctx SafeLLamaContextHandle

index Int32

Returns

LLamaToken

Apply(SafeLLamaContextHandle, LLamaTokenDataArray)

1
public void Apply(SafeLLamaContextHandle ctx, LLamaTokenDataArray data)

Parameters

ctx SafeLLamaContextHandle

data LLamaTokenDataArray

Apply(SafeLLamaContextHandle, LLamaTokenDataArrayNative&)

Apply this sampling chain to a LLamaTokenDataArrayNative

1
public void Apply(SafeLLamaContextHandle ctx, LLamaTokenDataArrayNative& data)

Parameters

ctx SafeLLamaContextHandle

data LLamaTokenDataArrayNative&

Reset()

1
public void Reset()

Accept(LLamaToken)

1
public void Accept(LLamaToken token)

Parameters

token LLamaToken


< Back