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.llamaweights.md 2.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # LLamaWeights
  2. Namespace: LLama
  3. A set of model weights, loaded into memory.
  4. ```csharp
  5. public sealed class LLamaWeights : System.IDisposable
  6. ```
  7. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [LLamaWeights](./llama.llamaweights.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 SafeLlamaModelHandle NativeHandle { get; }
  14. ```
  15. #### Property Value
  16. [SafeLlamaModelHandle](./llama.native.safellamamodelhandle.md)<br>
  17. **Remarks:**
  18. Be careful how you use this!
  19. ### **Encoding**
  20. Encoding to use to convert text into bytes for the model
  21. ```csharp
  22. public Encoding Encoding { get; }
  23. ```
  24. #### Property Value
  25. [Encoding](https://docs.microsoft.com/en-us/dotnet/api/system.text.encoding)<br>
  26. ### **VocabCount**
  27. Total number of tokens in vocabulary of this model
  28. ```csharp
  29. public int VocabCount { get; }
  30. ```
  31. #### Property Value
  32. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  33. ### **ContextSize**
  34. Total number of tokens in the context
  35. ```csharp
  36. public int ContextSize { get; }
  37. ```
  38. #### Property Value
  39. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  40. ### **EmbeddingSize**
  41. Dimension of embedding vectors
  42. ```csharp
  43. public int EmbeddingSize { get; }
  44. ```
  45. #### Property Value
  46. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  47. ## Methods
  48. ### **LoadFromFile(IModelParams)**
  49. Load weights into memory
  50. ```csharp
  51. public static LLamaWeights LoadFromFile(IModelParams params)
  52. ```
  53. #### Parameters
  54. `params` [IModelParams](./llama.abstractions.imodelparams.md)<br>
  55. #### Returns
  56. [LLamaWeights](./llama.llamaweights.md)<br>
  57. ### **Dispose()**
  58. ```csharp
  59. public void Dispose()
  60. ```
  61. ### **CreateContext(IModelParams)**
  62. Create a llama_context using this model
  63. ```csharp
  64. public LLamaContext CreateContext(IModelParams params)
  65. ```
  66. #### Parameters
  67. `params` [IModelParams](./llama.abstractions.imodelparams.md)<br>
  68. #### Returns
  69. [LLamaContext](./llama.llamacontext.md)<br>