Namespace: LLama.Native
A reference to a set of llava model weights.
public sealed class SafeLlavaModelHandle : SafeLLamaHandleBase, System.IDisposable
Inheritance Object → CriticalFinalizerObject → SafeHandle → SafeLLamaHandleBase → SafeLlavaModelHandle
Implements IDisposable
public bool IsInvalid { get; }
public bool IsClosed { get; }
protected bool ReleaseHandle()
Load a model from the given file path into memory
public static SafeLlavaModelHandle LoadFromFile(string modelPath, int verbosity)
modelPath String
MMP File (Multi-Modal Projections)
verbosity Int32
Verbosity level
SafeLlavaModelHandle
SafeHandle of the Clip Model
Create the Image Embeddings.
public SafeLlavaImageEmbedHandle CreateImageEmbeddings(LLamaContext ctxLlama, string image)
ctxLlama LLamaContext
LLama Context
image String
Image filename (it supports jpeg format only)
SafeLlavaImageEmbedHandle
return the SafeHandle of these embeddings
Create the Image Embeddings.
public SafeLlavaImageEmbedHandle CreateImageEmbeddings(LLamaContext ctxLlama, Byte[] image)
ctxLlama LLamaContext
LLama Context
image Byte[]
Image in binary format (it supports jpeg format only)
SafeLlavaImageEmbedHandle
return the SafeHandle of these embeddings
Evaluates the image embeddings.
public bool EvalImageEmbed(LLamaContext ctxLlama, SafeLlavaImageEmbedHandle imageEmbed, Int32& n_past)
ctxLlama LLamaContext
Llama Context
imageEmbed SafeLlavaImageEmbedHandle
The current embeddings to evaluate
n_past Int32&
Boolean
True on success