You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

llama.llavaweights.md 2.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. # LLavaWeights
  2. Namespace: LLama
  3. A set of llava model weights (mmproj), loaded into memory.
  4. ```csharp
  5. public sealed class LLavaWeights : System.IDisposable
  6. ```
  7. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [LLavaWeights](./llama.llavaweights.md)<br>
  8. Implements [IDisposable](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable)
  9. ## Properties
  10. ### **NativeHandle**
  11. The native handle, which is used in the native APIs
  12. ```csharp
  13. public SafeLlavaModelHandle NativeHandle { get; }
  14. ```
  15. #### Property Value
  16. [SafeLlavaModelHandle](./llama.native.safellavamodelhandle.md)<br>
  17. **Remarks:**
  18. Be careful how you use this!
  19. ## Methods
  20. ### **LoadFromFile(String)**
  21. Load weights into memory
  22. ```csharp
  23. public static LLavaWeights LoadFromFile(string mmProject)
  24. ```
  25. #### Parameters
  26. `mmProject` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  27. path to the "mmproj" model file
  28. #### Returns
  29. [LLavaWeights](./llama.llavaweights.md)<br>
  30. ### **CreateImageEmbeddings(LLamaContext, Byte[])**
  31. Create the Image Embeddings from the bytes of an image.
  32. ```csharp
  33. public SafeLlavaImageEmbedHandle CreateImageEmbeddings(LLamaContext ctxLlama, Byte[] image)
  34. ```
  35. #### Parameters
  36. `ctxLlama` [LLamaContext](./llama.llamacontext.md)<br>
  37. `image` [Byte[]](https://docs.microsoft.com/en-us/dotnet/api/system.byte)<br>
  38. Image bytes. Supported formats:
  39. JPGPNGBMPTGA
  40. #### Returns
  41. [SafeLlavaImageEmbedHandle](./llama.native.safellavaimageembedhandle.md)<br>
  42. ### **CreateImageEmbeddings(LLamaContext, String)**
  43. Create the Image Embeddings from the bytes of an image.
  44. ```csharp
  45. public SafeLlavaImageEmbedHandle CreateImageEmbeddings(LLamaContext ctxLlama, string image)
  46. ```
  47. #### Parameters
  48. `ctxLlama` [LLamaContext](./llama.llamacontext.md)<br>
  49. `image` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  50. Path to the image file. Supported formats:
  51. JPGPNGBMPTGA
  52. #### Returns
  53. [SafeLlavaImageEmbedHandle](./llama.native.safellavaimageembedhandle.md)<br>
  54. #### Exceptions
  55. [InvalidOperationException](https://docs.microsoft.com/en-us/dotnet/api/system.invalidoperationexception)<br>
  56. ### **EvalImageEmbed(LLamaContext, SafeLlavaImageEmbedHandle, Int32&)**
  57. Eval the image embeddings
  58. ```csharp
  59. public bool EvalImageEmbed(LLamaContext ctxLlama, SafeLlavaImageEmbedHandle imageEmbed, Int32& n_past)
  60. ```
  61. #### Parameters
  62. `ctxLlama` [LLamaContext](./llama.llamacontext.md)<br>
  63. `imageEmbed` [SafeLlavaImageEmbedHandle](./llama.native.safellavaimageembedhandle.md)<br>
  64. `n_past` [Int32&](https://docs.microsoft.com/en-us/dotnet/api/system.int32&)<br>
  65. #### Returns
  66. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  67. ### **Dispose()**
  68. ```csharp
  69. public void Dispose()
  70. ```