Skip to content

< Back


InteractiveExecutor

Namespace: LLama

The LLama executor for interactive mode.

1
public class InteractiveExecutor : StatefulExecutorBase, LLama.Abstractions.ILLamaExecutor

Inheritance ObjectStatefulExecutorBaseInteractiveExecutor
Implements ILLamaExecutor
Attributes NullableContextAttribute, NullableAttribute

Fields

_logger

The logger used by this executor.

1
protected ILogger _logger;

_pastTokensCount

The tokens that were already processed by the model.

1
protected int _pastTokensCount;

_consumedTokensCount

The tokens that were consumed by the model during the current inference.

1
protected int _consumedTokensCount;

_n_session_consumed

1
protected int _n_session_consumed;

_n_matching_session_tokens

1
protected int _n_matching_session_tokens;

_pathSession

The path of the session file.

1
protected string _pathSession;

_embeds

A container of the tokens to be processed and after processed.

1
protected List<LLamaToken> _embeds;

_embed_inps

A container for the tokens of input.

1
protected List<LLamaToken> _embed_inps;

_session_tokens

1
protected List<LLamaToken> _session_tokens;

_last_n_tokens

The last tokens generated by the model.

1
protected FixedSizeQueue<LLamaToken> _last_n_tokens;

Properties

Context

The context used by the executor.

1
public LLamaContext Context { get; }

Property Value

LLamaContext

IsMultiModal

1
public bool IsMultiModal { get; }

Property Value

Boolean

ClipModel

1
public LLavaWeights ClipModel { get; }

Property Value

LLavaWeights

Images

1
public List<Byte[]> Images { get; }

Property Value

List<Byte[]>

Constructors

InteractiveExecutor(LLamaContext, ILogger)

1
public InteractiveExecutor(LLamaContext context, ILogger logger)

Parameters

context LLamaContext

logger ILogger

InteractiveExecutor(LLamaContext, LLavaWeights, ILogger)

1
public InteractiveExecutor(LLamaContext context, LLavaWeights clipModel, ILogger logger)

Parameters

context LLamaContext

clipModel LLavaWeights

logger ILogger

Methods

GetStateData()

1
public ExecutorBaseState GetStateData()

Returns

ExecutorBaseState

LoadState(ExecutorBaseState)

1
public Task LoadState(ExecutorBaseState data)

Parameters

data ExecutorBaseState

Returns

Task

SaveState(String)

1
public Task SaveState(string filename)

Parameters

filename String

Returns

Task

LoadState(String)

1
public Task LoadState(string filename)

Parameters

filename String

Returns

Task

GetLoopCondition(InferStateArgs)

Define whether to continue the loop to generate responses.

1
protected Task<bool> GetLoopCondition(InferStateArgs args)

Parameters

args InferStateArgs

Returns

Task<Boolean>

PreprocessInputs(String, InferStateArgs)

1
protected Task PreprocessInputs(string text, InferStateArgs args)

Parameters

text String

args InferStateArgs

Returns

Task

PostProcess(IInferenceParams, InferStateArgs)

Return whether to break the generation.

1
protected Task<ValueTuple<bool, IReadOnlyList<string>>> PostProcess(IInferenceParams inferenceParams, InferStateArgs args)

Parameters

inferenceParams IInferenceParams

args InferStateArgs

Returns

Task<ValueTuple<Boolean, IReadOnlyList<String>>>

InferInternal(IInferenceParams, InferStateArgs)

1
protected Task InferInternal(IInferenceParams inferenceParams, InferStateArgs args)

Parameters

inferenceParams IInferenceParams

args InferStateArgs

Returns

Task


< Back