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.abstractions.imodelparams.md 5.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. # IModelParams
  2. Namespace: LLama.Abstractions
  3. The parameters for initializing a LLama model.
  4. ```csharp
  5. public interface IModelParams
  6. ```
  7. ## Properties
  8. ### **ContextSize**
  9. Model context size (n_ctx)
  10. ```csharp
  11. public abstract int ContextSize { get; set; }
  12. ```
  13. #### Property Value
  14. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  15. ### **MainGpu**
  16. the GPU that is used for scratch and small tensors
  17. ```csharp
  18. public abstract int MainGpu { get; set; }
  19. ```
  20. #### Property Value
  21. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  22. ### **LowVram**
  23. if true, reduce VRAM usage at the cost of performance
  24. ```csharp
  25. public abstract bool LowVram { get; set; }
  26. ```
  27. #### Property Value
  28. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  29. ### **GpuLayerCount**
  30. Number of layers to run in VRAM / GPU memory (n_gpu_layers)
  31. ```csharp
  32. public abstract int GpuLayerCount { get; set; }
  33. ```
  34. #### Property Value
  35. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  36. ### **Seed**
  37. Seed for the random number generator (seed)
  38. ```csharp
  39. public abstract int Seed { get; set; }
  40. ```
  41. #### Property Value
  42. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  43. ### **UseFp16Memory**
  44. Use f16 instead of f32 for memory kv (memory_f16)
  45. ```csharp
  46. public abstract bool UseFp16Memory { get; set; }
  47. ```
  48. #### Property Value
  49. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  50. ### **UseMemorymap**
  51. Use mmap for faster loads (use_mmap)
  52. ```csharp
  53. public abstract bool UseMemorymap { get; set; }
  54. ```
  55. #### Property Value
  56. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  57. ### **UseMemoryLock**
  58. Use mlock to keep model in memory (use_mlock)
  59. ```csharp
  60. public abstract bool UseMemoryLock { get; set; }
  61. ```
  62. #### Property Value
  63. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  64. ### **Perplexity**
  65. Compute perplexity over the prompt (perplexity)
  66. ```csharp
  67. public abstract bool Perplexity { get; set; }
  68. ```
  69. #### Property Value
  70. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  71. ### **ModelPath**
  72. Model path (model)
  73. ```csharp
  74. public abstract string ModelPath { get; set; }
  75. ```
  76. #### Property Value
  77. [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  78. ### **ModelAlias**
  79. model alias
  80. ```csharp
  81. public abstract string ModelAlias { get; set; }
  82. ```
  83. #### Property Value
  84. [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  85. ### **LoraAdapter**
  86. lora adapter path (lora_adapter)
  87. ```csharp
  88. public abstract string LoraAdapter { get; set; }
  89. ```
  90. #### Property Value
  91. [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  92. ### **LoraBase**
  93. base model path for the lora adapter (lora_base)
  94. ```csharp
  95. public abstract string LoraBase { get; set; }
  96. ```
  97. #### Property Value
  98. [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  99. ### **Threads**
  100. Number of threads (-1 = autodetect) (n_threads)
  101. ```csharp
  102. public abstract int Threads { get; set; }
  103. ```
  104. #### Property Value
  105. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  106. ### **BatchSize**
  107. batch size for prompt processing (must be &gt;=32 to use BLAS) (n_batch)
  108. ```csharp
  109. public abstract int BatchSize { get; set; }
  110. ```
  111. #### Property Value
  112. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  113. ### **ConvertEosToNewLine**
  114. Whether to convert eos to newline during the inference.
  115. ```csharp
  116. public abstract bool ConvertEosToNewLine { get; set; }
  117. ```
  118. #### Property Value
  119. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  120. ### **EmbeddingMode**
  121. Whether to use embedding mode. (embedding) Note that if this is set to true,
  122. The LLamaModel won't produce text response anymore.
  123. ```csharp
  124. public abstract bool EmbeddingMode { get; set; }
  125. ```
  126. #### Property Value
  127. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  128. ### **TensorSplits**
  129. how split tensors should be distributed across GPUs
  130. ```csharp
  131. public abstract Single[] TensorSplits { get; set; }
  132. ```
  133. #### Property Value
  134. [Single[]](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  135. ### **RopeFrequencyBase**
  136. RoPE base frequency
  137. ```csharp
  138. public abstract float RopeFrequencyBase { get; set; }
  139. ```
  140. #### Property Value
  141. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  142. ### **RopeFrequencyScale**
  143. RoPE frequency scaling factor
  144. ```csharp
  145. public abstract float RopeFrequencyScale { get; set; }
  146. ```
  147. #### Property Value
  148. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  149. ### **MulMatQ**
  150. Use experimental mul_mat_q kernels
  151. ```csharp
  152. public abstract bool MulMatQ { get; set; }
  153. ```
  154. #### Property Value
  155. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  156. ### **Encoding**
  157. The encoding to use for models
  158. ```csharp
  159. public abstract Encoding Encoding { get; set; }
  160. ```
  161. #### Property Value
  162. [Encoding](https://docs.microsoft.com/en-us/dotnet/api/system.text.encoding)<br>