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.iinferenceparams.md 4.7 kB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. # IInferenceParams
  2. Namespace: LLama.Abstractions
  3. The parameters used for inference.
  4. ```csharp
  5. public interface IInferenceParams
  6. ```
  7. ## Properties
  8. ### **TokensKeep**
  9. number of tokens to keep from initial prompt
  10. ```csharp
  11. public abstract int TokensKeep { get; set; }
  12. ```
  13. #### Property Value
  14. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  15. ### **MaxTokens**
  16. how many new tokens to predict (n_predict), set to -1 to inifinitely generate response
  17. until it complete.
  18. ```csharp
  19. public abstract int MaxTokens { get; set; }
  20. ```
  21. #### Property Value
  22. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  23. ### **LogitBias**
  24. logit bias for specific tokens
  25. ```csharp
  26. public abstract Dictionary<LLamaToken, float> LogitBias { get; set; }
  27. ```
  28. #### Property Value
  29. [Dictionary&lt;LLamaToken, Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
  30. ### **AntiPrompts**
  31. Sequences where the model will stop generating further tokens.
  32. ```csharp
  33. public abstract IReadOnlyList<string> AntiPrompts { get; set; }
  34. ```
  35. #### Property Value
  36. [IReadOnlyList&lt;String&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlylist-1)<br>
  37. ### **TopK**
  38. 0 or lower to use vocab size
  39. ```csharp
  40. public abstract int TopK { get; set; }
  41. ```
  42. #### Property Value
  43. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  44. ### **TopP**
  45. 1.0 = disabled
  46. ```csharp
  47. public abstract float TopP { get; set; }
  48. ```
  49. #### Property Value
  50. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  51. ### **MinP**
  52. 0.0 = disabled
  53. ```csharp
  54. public abstract float MinP { get; set; }
  55. ```
  56. #### Property Value
  57. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  58. ### **TfsZ**
  59. 1.0 = disabled
  60. ```csharp
  61. public abstract float TfsZ { get; set; }
  62. ```
  63. #### Property Value
  64. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  65. ### **TypicalP**
  66. 1.0 = disabled
  67. ```csharp
  68. public abstract float TypicalP { get; set; }
  69. ```
  70. #### Property Value
  71. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  72. ### **Temperature**
  73. 1.0 = disabled
  74. ```csharp
  75. public abstract float Temperature { get; set; }
  76. ```
  77. #### Property Value
  78. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  79. ### **RepeatPenalty**
  80. 1.0 = disabled
  81. ```csharp
  82. public abstract float RepeatPenalty { get; set; }
  83. ```
  84. #### Property Value
  85. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  86. ### **RepeatLastTokensCount**
  87. last n tokens to penalize (0 = disable penalty, -1 = context size) (repeat_last_n)
  88. ```csharp
  89. public abstract int RepeatLastTokensCount { get; set; }
  90. ```
  91. #### Property Value
  92. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  93. ### **FrequencyPenalty**
  94. frequency penalty coefficient
  95. 0.0 = disabled
  96. ```csharp
  97. public abstract float FrequencyPenalty { get; set; }
  98. ```
  99. #### Property Value
  100. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  101. ### **PresencePenalty**
  102. presence penalty coefficient
  103. 0.0 = disabled
  104. ```csharp
  105. public abstract float PresencePenalty { get; set; }
  106. ```
  107. #### Property Value
  108. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  109. ### **Mirostat**
  110. Mirostat uses tokens instead of words.
  111. algorithm described in the paper https://arxiv.org/abs/2007.14966.
  112. 0 = disabled, 1 = mirostat, 2 = mirostat 2.0
  113. ```csharp
  114. public abstract MirostatType Mirostat { get; set; }
  115. ```
  116. #### Property Value
  117. [MirostatType](./llama.common.mirostattype.md)<br>
  118. ### **MirostatTau**
  119. target entropy
  120. ```csharp
  121. public abstract float MirostatTau { get; set; }
  122. ```
  123. #### Property Value
  124. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  125. ### **MirostatEta**
  126. learning rate
  127. ```csharp
  128. public abstract float MirostatEta { get; set; }
  129. ```
  130. #### Property Value
  131. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  132. ### **PenalizeNL**
  133. consider newlines as a repeatable token (penalize_nl)
  134. ```csharp
  135. public abstract bool PenalizeNL { get; set; }
  136. ```
  137. #### Property Value
  138. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  139. ### **Grammar**
  140. Grammar to constrain possible tokens
  141. ```csharp
  142. public abstract SafeLLamaGrammarHandle Grammar { get; set; }
  143. ```
  144. #### Property Value
  145. [SafeLLamaGrammarHandle](./llama.native.safellamagrammarhandle.md)<br>
  146. ### **SamplingPipeline**
  147. Set a custom sampling pipeline to use. If this is set All other sampling parameters are ignored!
  148. ```csharp
  149. public abstract ISamplingPipeline SamplingPipeline { get; set; }
  150. ```
  151. #### Property Value
  152. [ISamplingPipeline](./llama.sampling.isamplingpipeline.md)<br>