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.common.modelparams.md 8.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. # ModelParams
  2. Namespace: LLama.Common
  3. The parameters for initializing a LLama model.
  4. ```csharp
  5. public class ModelParams : LLama.Abstractions.ILLamaParams, LLama.Abstractions.IModelParams, LLama.Abstractions.IContextParams, System.IEquatable`1[[LLama.Common.ModelParams, LLamaSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]
  6. ```
  7. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [ModelParams](./llama.common.modelparams.md)<br>
  8. Implements [ILLamaParams](./llama.abstractions.illamaparams.md), [IModelParams](./llama.abstractions.imodelparams.md), [IContextParams](./llama.abstractions.icontextparams.md), [IEquatable&lt;ModelParams&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.iequatable-1)
  9. ## Properties
  10. ### **ContextSize**
  11. ```csharp
  12. public Nullable<uint> ContextSize { get; set; }
  13. ```
  14. #### Property Value
  15. [Nullable&lt;UInt32&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  16. ### **MainGpu**
  17. ```csharp
  18. public int MainGpu { get; set; }
  19. ```
  20. #### Property Value
  21. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  22. ### **SplitMode**
  23. ```csharp
  24. public GPUSplitMode SplitMode { get; set; }
  25. ```
  26. #### Property Value
  27. [GPUSplitMode](./llama.native.gpusplitmode.md)<br>
  28. ### **GpuLayerCount**
  29. ```csharp
  30. public int GpuLayerCount { get; set; }
  31. ```
  32. #### Property Value
  33. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  34. ### **Seed**
  35. ```csharp
  36. public uint Seed { get; set; }
  37. ```
  38. #### Property Value
  39. [UInt32](https://docs.microsoft.com/en-us/dotnet/api/system.uint32)<br>
  40. ### **UseMemorymap**
  41. ```csharp
  42. public bool UseMemorymap { get; set; }
  43. ```
  44. #### Property Value
  45. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  46. ### **UseMemoryLock**
  47. ```csharp
  48. public bool UseMemoryLock { get; set; }
  49. ```
  50. #### Property Value
  51. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  52. ### **ModelPath**
  53. ```csharp
  54. public string ModelPath { get; set; }
  55. ```
  56. #### Property Value
  57. [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  58. ### **LoraAdapters**
  59. ```csharp
  60. public AdapterCollection LoraAdapters { get; set; }
  61. ```
  62. #### Property Value
  63. [AdapterCollection](./llama.abstractions.adaptercollection.md)<br>
  64. ### **LoraBase**
  65. ```csharp
  66. public string LoraBase { get; set; }
  67. ```
  68. #### Property Value
  69. [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  70. ### **Threads**
  71. ```csharp
  72. public Nullable<uint> Threads { get; set; }
  73. ```
  74. #### Property Value
  75. [Nullable&lt;UInt32&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  76. ### **BatchThreads**
  77. ```csharp
  78. public Nullable<uint> BatchThreads { get; set; }
  79. ```
  80. #### Property Value
  81. [Nullable&lt;UInt32&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  82. ### **BatchSize**
  83. ```csharp
  84. public uint BatchSize { get; set; }
  85. ```
  86. #### Property Value
  87. [UInt32](https://docs.microsoft.com/en-us/dotnet/api/system.uint32)<br>
  88. ### **EmbeddingMode**
  89. ```csharp
  90. public bool EmbeddingMode { get; set; }
  91. ```
  92. #### Property Value
  93. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  94. ### **TensorSplits**
  95. ```csharp
  96. public TensorSplitsCollection TensorSplits { get; set; }
  97. ```
  98. #### Property Value
  99. [TensorSplitsCollection](./llama.abstractions.tensorsplitscollection.md)<br>
  100. ### **MetadataOverrides**
  101. ```csharp
  102. public List<MetadataOverride> MetadataOverrides { get; set; }
  103. ```
  104. #### Property Value
  105. [List&lt;MetadataOverride&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1)<br>
  106. ### **RopeFrequencyBase**
  107. ```csharp
  108. public Nullable<float> RopeFrequencyBase { get; set; }
  109. ```
  110. #### Property Value
  111. [Nullable&lt;Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  112. ### **RopeFrequencyScale**
  113. ```csharp
  114. public Nullable<float> RopeFrequencyScale { get; set; }
  115. ```
  116. #### Property Value
  117. [Nullable&lt;Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  118. ### **YarnExtrapolationFactor**
  119. ```csharp
  120. public Nullable<float> YarnExtrapolationFactor { get; set; }
  121. ```
  122. #### Property Value
  123. [Nullable&lt;Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  124. ### **YarnAttentionFactor**
  125. ```csharp
  126. public Nullable<float> YarnAttentionFactor { get; set; }
  127. ```
  128. #### Property Value
  129. [Nullable&lt;Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  130. ### **YarnBetaFast**
  131. ```csharp
  132. public Nullable<float> YarnBetaFast { get; set; }
  133. ```
  134. #### Property Value
  135. [Nullable&lt;Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  136. ### **YarnBetaSlow**
  137. ```csharp
  138. public Nullable<float> YarnBetaSlow { get; set; }
  139. ```
  140. #### Property Value
  141. [Nullable&lt;Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  142. ### **YarnOriginalContext**
  143. ```csharp
  144. public Nullable<uint> YarnOriginalContext { get; set; }
  145. ```
  146. #### Property Value
  147. [Nullable&lt;UInt32&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  148. ### **YarnScalingType**
  149. ```csharp
  150. public Nullable<RopeScalingType> YarnScalingType { get; set; }
  151. ```
  152. #### Property Value
  153. [Nullable&lt;RopeScalingType&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  154. ### **TypeK**
  155. ```csharp
  156. public Nullable<GGMLType> TypeK { get; set; }
  157. ```
  158. #### Property Value
  159. [Nullable&lt;GGMLType&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  160. ### **TypeV**
  161. ```csharp
  162. public Nullable<GGMLType> TypeV { get; set; }
  163. ```
  164. #### Property Value
  165. [Nullable&lt;GGMLType&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  166. ### **NoKqvOffload**
  167. ```csharp
  168. public bool NoKqvOffload { get; set; }
  169. ```
  170. #### Property Value
  171. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  172. ### **DefragThreshold**
  173. ```csharp
  174. public float DefragThreshold { get; set; }
  175. ```
  176. #### Property Value
  177. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  178. ### **DoPooling**
  179. ```csharp
  180. public bool DoPooling { get; set; }
  181. ```
  182. #### Property Value
  183. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  184. ### **VocabOnly**
  185. ```csharp
  186. public bool VocabOnly { get; set; }
  187. ```
  188. #### Property Value
  189. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  190. ### **Encoding**
  191. ```csharp
  192. public Encoding Encoding { get; set; }
  193. ```
  194. #### Property Value
  195. [Encoding](https://docs.microsoft.com/en-us/dotnet/api/system.text.encoding)<br>
  196. ## Constructors
  197. ### **ModelParams(String)**
  198. ```csharp
  199. public ModelParams(string modelPath)
  200. ```
  201. #### Parameters
  202. `modelPath` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  203. The model path.
  204. ## Methods
  205. ### **ToString()**
  206. ```csharp
  207. public string ToString()
  208. ```
  209. #### Returns
  210. [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  211. ### **PrintMembers(StringBuilder)**
  212. ```csharp
  213. protected bool PrintMembers(StringBuilder builder)
  214. ```
  215. #### Parameters
  216. `builder` [StringBuilder](https://docs.microsoft.com/en-us/dotnet/api/system.text.stringbuilder)<br>
  217. #### Returns
  218. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  219. ### **GetHashCode()**
  220. ```csharp
  221. public int GetHashCode()
  222. ```
  223. #### Returns
  224. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  225. ### **Equals(Object)**
  226. ```csharp
  227. public bool Equals(object obj)
  228. ```
  229. #### Parameters
  230. `obj` [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object)<br>
  231. #### Returns
  232. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  233. ### **Equals(ModelParams)**
  234. ```csharp
  235. public bool Equals(ModelParams other)
  236. ```
  237. #### Parameters
  238. `other` [ModelParams](./llama.common.modelparams.md)<br>
  239. #### Returns
  240. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  241. ### **&lt;Clone&gt;$()**
  242. ```csharp
  243. public ModelParams <Clone>$()
  244. ```
  245. #### Returns
  246. [ModelParams](./llama.common.modelparams.md)<br>