|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- # LLamaWeights
-
- Namespace: LLama
-
- A set of model weights, loaded into memory.
-
- ```csharp
- public sealed class LLamaWeights : System.IDisposable
- ```
-
- Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [LLamaWeights](./llama.llamaweights.md)<br>
- Implements [IDisposable](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable)
-
- ## Properties
-
- ### **NativeHandle**
-
- The native handle, which is used in the native APIs
-
- ```csharp
- public SafeLlamaModelHandle NativeHandle { get; }
- ```
-
- #### Property Value
-
- [SafeLlamaModelHandle](./llama.native.safellamamodelhandle.md)<br>
-
- **Remarks:**
-
- Be careful how you use this!
-
- ### **Encoding**
-
- Encoding to use to convert text into bytes for the model
-
- ```csharp
- public Encoding Encoding { get; }
- ```
-
- #### Property Value
-
- [Encoding](https://docs.microsoft.com/en-us/dotnet/api/system.text.encoding)<br>
-
- ### **VocabCount**
-
- Total number of tokens in vocabulary of this model
-
- ```csharp
- public int VocabCount { get; }
- ```
-
- #### Property Value
-
- [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- ### **ContextSize**
-
- Total number of tokens in the context
-
- ```csharp
- public int ContextSize { get; }
- ```
-
- #### Property Value
-
- [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- ### **EmbeddingSize**
-
- Dimension of embedding vectors
-
- ```csharp
- public int EmbeddingSize { get; }
- ```
-
- #### Property Value
-
- [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- ## Methods
-
- ### **LoadFromFile(IModelParams)**
-
- Load weights into memory
-
- ```csharp
- public static LLamaWeights LoadFromFile(IModelParams params)
- ```
-
- #### Parameters
-
- `params` [IModelParams](./llama.abstractions.imodelparams.md)<br>
-
- #### Returns
-
- [LLamaWeights](./llama.llamaweights.md)<br>
-
- ### **Dispose()**
-
- ```csharp
- public void Dispose()
- ```
-
- ### **CreateContext(IModelParams)**
-
- Create a llama_context using this model
-
- ```csharp
- public LLamaContext CreateContext(IModelParams params)
- ```
-
- #### Parameters
-
- `params` [IModelParams](./llama.abstractions.imodelparams.md)<br>
-
- #### Returns
-
- [LLamaContext](./llama.llamacontext.md)<br>
|