Skip to content

< Back


SafeLlavaImageEmbedHandle

Namespace: LLama.Native

A Reference to a llava Image Embed handle

1
public sealed class SafeLlavaImageEmbedHandle : SafeLLamaHandleBase, System.IDisposable

Inheritance ObjectCriticalFinalizerObjectSafeHandleSafeLLamaHandleBaseSafeLlavaImageEmbedHandle
Implements IDisposable
Attributes NullableContextAttribute, NullableAttribute

Fields

handle

1
protected IntPtr handle;

Properties

Model

Get the model used to create this image embedding

1
public SafeLlavaModelHandle Model { get; private set; }

Property Value

SafeLlavaModelHandle

EmbeddingDimensions

Get the number of dimensions in an embedding

1
public int EmbeddingDimensions { get; }

Property Value

Int32

PatchCount

Get the number of "patches" in an image embedding

1
public int PatchCount { get; }

Property Value

Int32

IsInvalid

1
public bool IsInvalid { get; }

Property Value

Boolean

IsClosed

1
public bool IsClosed { get; }

Property Value

Boolean

Constructors

SafeLlavaImageEmbedHandle()

1
public SafeLlavaImageEmbedHandle()

Methods

CreateFromFileName(SafeLlavaModelHandle, LLamaContext, String)

Create an image embed from an image file

1
public static SafeLlavaImageEmbedHandle CreateFromFileName(SafeLlavaModelHandle clip, LLamaContext ctx, string image)

Parameters

clip SafeLlavaModelHandle

ctx LLamaContext

image String
Path to the image file. Supported formats:

-

-

Returns

SafeLlavaImageEmbedHandle

Exceptions

InvalidOperationException

CreateFromFileName(SafeLlavaModelHandle, String, Int32)

Create an image embed from an image file

1
public static SafeLlavaImageEmbedHandle CreateFromFileName(SafeLlavaModelHandle clip, string image, int threads)

Parameters

clip SafeLlavaModelHandle

image String
Path to the image file. Supported formats:

-

-

threads Int32

Returns

SafeLlavaImageEmbedHandle

Exceptions

InvalidOperationException

CreateFromMemory(SafeLlavaModelHandle, LLamaContext, Byte[])

Create an image embed from the bytes of an image.

1
public static SafeLlavaImageEmbedHandle CreateFromMemory(SafeLlavaModelHandle clip, LLamaContext ctx, Byte[] image)

Parameters

clip SafeLlavaModelHandle

ctx LLamaContext

image Byte[]
Image bytes. Supported formats:

-

-

Returns

SafeLlavaImageEmbedHandle

CreateFromMemory(SafeLlavaModelHandle, Byte[], Int32)

Create an image embed from the bytes of an image.

1
public static SafeLlavaImageEmbedHandle CreateFromMemory(SafeLlavaModelHandle clip, Byte[] image, int threads)

Parameters

clip SafeLlavaModelHandle

image Byte[]
Image bytes. Supported formats:

-

-

threads Int32

Returns

SafeLlavaImageEmbedHandle

ReleaseHandle()

1
protected bool ReleaseHandle()

Returns

Boolean

GetEmbedding(Span<Single>, Int32)

Copy the embeddings data to the destination span

1
public void GetEmbedding(Span<float> dest, int index)

Parameters

dest Span<Single>

index Int32


< Back