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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # LLamaModelParams
  2. Namespace: LLama.Native
  3. A C# representation of the llama.cpp `llama_model_params` struct
  4. ```csharp
  5. public struct LLamaModelParams
  6. ```
  7. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [ValueType](https://docs.microsoft.com/en-us/dotnet/api/system.valuetype) → [LLamaModelParams](./llama.native.llamamodelparams.md)
  8. ## Fields
  9. ### **n_gpu_layers**
  10. // number of layers to store in VRAM
  11. ```csharp
  12. public int n_gpu_layers;
  13. ```
  14. ### **split_mode**
  15. how to split the model across multiple GPUs
  16. ```csharp
  17. public GPUSplitMode split_mode;
  18. ```
  19. ### **main_gpu**
  20. the GPU that is used for scratch and small tensors
  21. ```csharp
  22. public int main_gpu;
  23. ```
  24. ### **tensor_split**
  25. how to split layers across multiple GPUs (size: [NativeApi.llama_max_devices()](./llama.native.nativeapi.md#llama_max_devices))
  26. ```csharp
  27. public Single* tensor_split;
  28. ```
  29. ### **progress_callback**
  30. called with a progress value between 0 and 1, pass NULL to disable. If the provided progress_callback
  31. returns true, model loading continues. If it returns false, model loading is immediately aborted.
  32. ```csharp
  33. public LlamaProgressCallback progress_callback;
  34. ```
  35. ### **progress_callback_user_data**
  36. context pointer passed to the progress callback
  37. ```csharp
  38. public Void* progress_callback_user_data;
  39. ```
  40. ### **kv_overrides**
  41. override key-value pairs of the model meta data
  42. ```csharp
  43. public LLamaModelMetadataOverride* kv_overrides;
  44. ```
  45. ## Properties
  46. ### **vocab_only**
  47. only load the vocabulary, no weights
  48. ```csharp
  49. public bool vocab_only { get; set; }
  50. ```
  51. #### Property Value
  52. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  53. ### **use_mmap**
  54. use mmap if possible
  55. ```csharp
  56. public bool use_mmap { get; set; }
  57. ```
  58. #### Property Value
  59. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  60. ### **use_mlock**
  61. force system to keep model in RAM
  62. ```csharp
  63. public bool use_mlock { get; set; }
  64. ```
  65. #### Property Value
  66. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>