Skip to content

LLamaWeights

Namespace: LLama

A set of model weights, loaded into memory.

public sealed class LLamaWeights : System.IDisposable

Inheritance ObjectLLamaWeights
Implements IDisposable

Properties

NativeHandle

The native handle, which is used in the native APIs

public SafeLlamaModelHandle NativeHandle { get; }

Property Value

SafeLlamaModelHandle

Remarks:

Be careful how you use this!

Encoding

Encoding to use to convert text into bytes for the model

public Encoding Encoding { get; }

Property Value

Encoding

VocabCount

Total number of tokens in vocabulary of this model

public int VocabCount { get; }

Property Value

Int32

ContextSize

Total number of tokens in the context

public int ContextSize { get; }

Property Value

Int32

EmbeddingSize

Dimension of embedding vectors

public int EmbeddingSize { get; }

Property Value

Int32

Methods

LoadFromFile(IModelParams)

Load weights into memory

public static LLamaWeights LoadFromFile(IModelParams params)

Parameters

params IModelParams

Returns

LLamaWeights

Dispose()

public void Dispose()

CreateContext(IModelParams)

Create a llama_context using this model

public LLamaContext CreateContext(IModelParams params)

Parameters

params IModelParams

Returns

LLamaContext