Skip to content

< Back


LLavaWeights

Namespace: LLama

A set of llava model weights (mmproj), loaded into memory.

1
public sealed class LLavaWeights : System.IDisposable

Inheritance ObjectLLavaWeights
Implements IDisposable
Attributes NullableContextAttribute, NullableAttribute

Properties

NativeHandle

The native handle, which is used in the native APIs

1
public SafeLlavaModelHandle NativeHandle { get; }

Property Value

SafeLlavaModelHandle

Remarks:

Be careful how you use this!

Methods

LoadFromFile(String)

Load weights into memory

1
public static LLavaWeights LoadFromFile(string mmProject)

Parameters

mmProject String
path to the "mmproj" model file

Returns

LLavaWeights

LoadFromFileAsync(String, CancellationToken)

Load weights into memory

1
public static Task<LLavaWeights> LoadFromFileAsync(string mmProject, CancellationToken token)

Parameters

mmProject String
path to the "mmproj" model file

token CancellationToken

Returns

Task<LLavaWeights>

CreateImageEmbeddings(LLamaContext, Byte[])

Create the Image Embeddings from the bytes of an image.

1
public SafeLlavaImageEmbedHandle CreateImageEmbeddings(LLamaContext ctxLlama, Byte[] image)

Parameters

ctxLlama LLamaContext

image Byte[]
Image bytes. Supported formats:

-

-

Returns

SafeLlavaImageEmbedHandle

CreateImageEmbeddings(Byte[], Int32)

Create the Image Embeddings.

1
public SafeLlavaImageEmbedHandle CreateImageEmbeddings(Byte[] image, int threads)

Parameters

image Byte[]
Image in binary format (it supports jpeg format only)

threads Int32
Number of threads to use

Returns

SafeLlavaImageEmbedHandle
return the SafeHandle of these embeddings

CreateImageEmbeddings(LLamaContext, String)

Create the Image Embeddings from the bytes of an image.

1
public SafeLlavaImageEmbedHandle CreateImageEmbeddings(LLamaContext ctxLlama, string image)

Parameters

ctxLlama LLamaContext

image String
Path to the image file. Supported formats:

-

-

Returns

SafeLlavaImageEmbedHandle

Exceptions

InvalidOperationException

CreateImageEmbeddings(String, Int32)

Create the Image Embeddings from the bytes of an image.

1
public SafeLlavaImageEmbedHandle CreateImageEmbeddings(string image, int threads)

Parameters

image String
Path to the image file. Supported formats:

-

-

threads Int32

Returns

SafeLlavaImageEmbedHandle

Exceptions

InvalidOperationException

EvalImageEmbed(LLamaContext, SafeLlavaImageEmbedHandle, Int32&)

Eval the image embeddings

1
public bool EvalImageEmbed(LLamaContext ctxLlama, SafeLlavaImageEmbedHandle imageEmbed, Int32& n_past)

Parameters

ctxLlama LLamaContext

imageEmbed SafeLlavaImageEmbedHandle

n_past Int32&

Returns

Boolean

Dispose()

1
public void Dispose()

< Back