# SafeLlavaModelHandle Namespace: LLama.Native A reference to a set of llava model weights. ```csharp public sealed class SafeLlavaModelHandle : SafeLLamaHandleBase, System.IDisposable ``` Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [CriticalFinalizerObject](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.constrainedexecution.criticalfinalizerobject) → [SafeHandle](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.safehandle) → [SafeLLamaHandleBase](./llama.native.safellamahandlebase.md) → [SafeLlavaModelHandle](./llama.native.safellavamodelhandle.md)
Implements [IDisposable](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable) ## Properties ### **IsInvalid** ```csharp public bool IsInvalid { get; } ``` #### Property Value [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)
### **IsClosed** ```csharp public bool IsClosed { get; } ``` #### Property Value [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)
## Methods ### **ReleaseHandle()** ```csharp protected bool ReleaseHandle() ``` #### Returns [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)
### **LoadFromFile(String, Int32)** Load a model from the given file path into memory ```csharp public static SafeLlavaModelHandle LoadFromFile(string modelPath, int verbosity) ``` #### Parameters `modelPath` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)
MMP File (Multi-Modal Projections) `verbosity` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
Verbosity level #### Returns [SafeLlavaModelHandle](./llama.native.safellavamodelhandle.md)
SafeHandle of the Clip Model #### Exceptions [InvalidOperationException](https://docs.microsoft.com/en-us/dotnet/api/system.invalidoperationexception)
[RuntimeError](./llama.exceptions.runtimeerror.md)
### **CreateImageEmbeddings(LLamaContext, String)** Create the Image Embeddings. ```csharp public SafeLlavaImageEmbedHandle CreateImageEmbeddings(LLamaContext ctxLlama, string image) ``` #### Parameters `ctxLlama` [LLamaContext](./llama.llamacontext.md)
LLama Context `image` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)
Image filename (it supports jpeg format only) #### Returns [SafeLlavaImageEmbedHandle](./llama.native.safellavaimageembedhandle.md)
return the SafeHandle of these embeddings ### **CreateImageEmbeddings(LLamaContext, Byte[])** Create the Image Embeddings. ```csharp public SafeLlavaImageEmbedHandle CreateImageEmbeddings(LLamaContext ctxLlama, Byte[] image) ``` #### Parameters `ctxLlama` [LLamaContext](./llama.llamacontext.md)
LLama Context `image` [Byte[]](https://docs.microsoft.com/en-us/dotnet/api/system.byte)
Image in binary format (it supports jpeg format only) #### Returns [SafeLlavaImageEmbedHandle](./llama.native.safellavaimageembedhandle.md)
return the SafeHandle of these embeddings ### **EvalImageEmbed(LLamaContext, SafeLlavaImageEmbedHandle, Int32&)** Evaluates the image embeddings. ```csharp public bool EvalImageEmbed(LLamaContext ctxLlama, SafeLlavaImageEmbedHandle imageEmbed, Int32& n_past) ``` #### Parameters `ctxLlama` [LLamaContext](./llama.llamacontext.md)
Llama Context `imageEmbed` [SafeLlavaImageEmbedHandle](./llama.native.safellavaimageembedhandle.md)
The current embeddings to evaluate `n_past` [Int32&](https://docs.microsoft.com/en-us/dotnet/api/system.int32&)
#### Returns [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)
True on success