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.inferenceparams.md 5.7 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. # InferenceParams
  2. Namespace: LLama.Common
  3. The paramters used for inference.
  4. ```csharp
  5. public class InferenceParams : LLama.Abstractions.IInferenceParams, System.IEquatable`1[[LLama.Common.InferenceParams, LLamaSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]
  6. ```
  7. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [InferenceParams](./llama.common.inferenceparams.md)<br>
  8. Implements [IInferenceParams](./llama.abstractions.iinferenceparams.md), [IEquatable&lt;InferenceParams&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.iequatable-1)
  9. ## Properties
  10. ### **TokensKeep**
  11. number of tokens to keep from initial prompt
  12. ```csharp
  13. public int TokensKeep { get; set; }
  14. ```
  15. #### Property Value
  16. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  17. ### **MaxTokens**
  18. how many new tokens to predict (n_predict), set to -1 to inifinitely generate response
  19. until it complete.
  20. ```csharp
  21. public int MaxTokens { get; set; }
  22. ```
  23. #### Property Value
  24. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  25. ### **LogitBias**
  26. logit bias for specific tokens
  27. ```csharp
  28. public Dictionary<LLamaToken, float> LogitBias { get; set; }
  29. ```
  30. #### Property Value
  31. [Dictionary&lt;LLamaToken, Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
  32. ### **AntiPrompts**
  33. Sequences where the model will stop generating further tokens.
  34. ```csharp
  35. public IReadOnlyList<string> AntiPrompts { get; set; }
  36. ```
  37. #### Property Value
  38. [IReadOnlyList&lt;String&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlylist-1)<br>
  39. ### **TopK**
  40. ```csharp
  41. public int TopK { get; set; }
  42. ```
  43. #### Property Value
  44. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  45. ### **TopP**
  46. ```csharp
  47. public float TopP { get; set; }
  48. ```
  49. #### Property Value
  50. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  51. ### **MinP**
  52. ```csharp
  53. public float MinP { get; set; }
  54. ```
  55. #### Property Value
  56. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  57. ### **TfsZ**
  58. ```csharp
  59. public float TfsZ { get; set; }
  60. ```
  61. #### Property Value
  62. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  63. ### **TypicalP**
  64. ```csharp
  65. public float TypicalP { get; set; }
  66. ```
  67. #### Property Value
  68. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  69. ### **Temperature**
  70. ```csharp
  71. public float Temperature { get; set; }
  72. ```
  73. #### Property Value
  74. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  75. ### **RepeatPenalty**
  76. ```csharp
  77. public float RepeatPenalty { get; set; }
  78. ```
  79. #### Property Value
  80. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  81. ### **RepeatLastTokensCount**
  82. ```csharp
  83. public int RepeatLastTokensCount { get; set; }
  84. ```
  85. #### Property Value
  86. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  87. ### **FrequencyPenalty**
  88. ```csharp
  89. public float FrequencyPenalty { get; set; }
  90. ```
  91. #### Property Value
  92. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  93. ### **PresencePenalty**
  94. ```csharp
  95. public float PresencePenalty { get; set; }
  96. ```
  97. #### Property Value
  98. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  99. ### **Mirostat**
  100. ```csharp
  101. public MirostatType Mirostat { get; set; }
  102. ```
  103. #### Property Value
  104. [MirostatType](./llama.common.mirostattype.md)<br>
  105. ### **MirostatTau**
  106. ```csharp
  107. public float MirostatTau { get; set; }
  108. ```
  109. #### Property Value
  110. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  111. ### **MirostatEta**
  112. ```csharp
  113. public float MirostatEta { get; set; }
  114. ```
  115. #### Property Value
  116. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  117. ### **PenalizeNL**
  118. ```csharp
  119. public bool PenalizeNL { get; set; }
  120. ```
  121. #### Property Value
  122. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  123. ### **Grammar**
  124. ```csharp
  125. public SafeLLamaGrammarHandle Grammar { get; set; }
  126. ```
  127. #### Property Value
  128. [SafeLLamaGrammarHandle](./llama.native.safellamagrammarhandle.md)<br>
  129. ### **SamplingPipeline**
  130. ```csharp
  131. public ISamplingPipeline SamplingPipeline { get; set; }
  132. ```
  133. #### Property Value
  134. [ISamplingPipeline](./llama.sampling.isamplingpipeline.md)<br>
  135. ## Constructors
  136. ### **InferenceParams()**
  137. ```csharp
  138. public InferenceParams()
  139. ```
  140. ## Methods
  141. ### **ToString()**
  142. ```csharp
  143. public string ToString()
  144. ```
  145. #### Returns
  146. [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  147. ### **PrintMembers(StringBuilder)**
  148. ```csharp
  149. protected bool PrintMembers(StringBuilder builder)
  150. ```
  151. #### Parameters
  152. `builder` [StringBuilder](https://docs.microsoft.com/en-us/dotnet/api/system.text.stringbuilder)<br>
  153. #### Returns
  154. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  155. ### **GetHashCode()**
  156. ```csharp
  157. public int GetHashCode()
  158. ```
  159. #### Returns
  160. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  161. ### **Equals(Object)**
  162. ```csharp
  163. public bool Equals(object obj)
  164. ```
  165. #### Parameters
  166. `obj` [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object)<br>
  167. #### Returns
  168. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  169. ### **Equals(InferenceParams)**
  170. ```csharp
  171. public bool Equals(InferenceParams other)
  172. ```
  173. #### Parameters
  174. `other` [InferenceParams](./llama.common.inferenceparams.md)<br>
  175. #### Returns
  176. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  177. ### **&lt;Clone&gt;$()**
  178. ```csharp
  179. public InferenceParams <Clone>$()
  180. ```
  181. #### Returns
  182. [InferenceParams](./llama.common.inferenceparams.md)<br>