LLamaSharp/docs/xmldocs/llama.instructexecutor.md

3.3 KiB

InstructExecutor

Namespace: LLama

The LLama executor for instruct mode.

public class InstructExecutor : StatefulExecutorBase, LLama.Abstractions.ILLamaExecutor

Inheritance ObjectStatefulExecutorBaseInstructExecutor
Implements ILLamaExecutor

Properties

Context

The context used by the executor.

public LLamaContext Context { get; }

Property Value

LLamaContext

Constructors

InstructExecutor(LLamaContext, String, String)

public InstructExecutor(LLamaContext context, string instructionPrefix, string instructionSuffix)

Parameters

context LLamaContext

instructionPrefix String

instructionSuffix String

Methods

GetStateData()

public ExecutorBaseState GetStateData()

Returns

ExecutorBaseState

LoadState(ExecutorBaseState)

public void LoadState(ExecutorBaseState data)

Parameters

data ExecutorBaseState

SaveState(String)

public void SaveState(string filename)

Parameters

filename String

LoadState(String)

public void LoadState(string filename)

Parameters

filename String

GetLoopCondition(InferStateArgs)

protected bool GetLoopCondition(InferStateArgs args)

Parameters

args InferStateArgs

Returns

Boolean

PreprocessInputs(String, InferStateArgs)

protected void PreprocessInputs(string text, InferStateArgs args)

Parameters

text String

args InferStateArgs

PostProcess(IInferenceParams, InferStateArgs, IEnumerable`1&)

protected bool PostProcess(IInferenceParams inferenceParams, InferStateArgs args, IEnumerable`1& extraOutputs)

Parameters

inferenceParams IInferenceParams

args InferStateArgs

extraOutputs IEnumerable`1&

Returns

Boolean

InferInternal(IInferenceParams, InferStateArgs)

protected void InferInternal(IInferenceParams inferenceParams, InferStateArgs args)

Parameters

inferenceParams IInferenceParams

args InferStateArgs