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.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. # IInferenceParams
  2. Namespace: LLama.Abstractions
  3. The paramters 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<int, float> LogitBias { get; set; }
  27. ```
  28. #### Property Value
  29. [Dictionary&lt;Int32, 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 IEnumerable<string> AntiPrompts { get; set; }
  34. ```
  35. #### Property Value
  36. [IEnumerable&lt;String&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)<br>
  37. ### **PathSession**
  38. path to file for saving/loading model eval state
  39. ```csharp
  40. public abstract string PathSession { get; set; }
  41. ```
  42. #### Property Value
  43. [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  44. ### **InputSuffix**
  45. string to suffix user inputs with
  46. ```csharp
  47. public abstract string InputSuffix { get; set; }
  48. ```
  49. #### Property Value
  50. [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  51. ### **InputPrefix**
  52. string to prefix user inputs with
  53. ```csharp
  54. public abstract string InputPrefix { get; set; }
  55. ```
  56. #### Property Value
  57. [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  58. ### **TopK**
  59. 0 or lower to use vocab size
  60. ```csharp
  61. public abstract int TopK { get; set; }
  62. ```
  63. #### Property Value
  64. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  65. ### **TopP**
  66. 1.0 = disabled
  67. ```csharp
  68. public abstract float TopP { get; set; }
  69. ```
  70. #### Property Value
  71. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  72. ### **TfsZ**
  73. 1.0 = disabled
  74. ```csharp
  75. public abstract float TfsZ { get; set; }
  76. ```
  77. #### Property Value
  78. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  79. ### **TypicalP**
  80. 1.0 = disabled
  81. ```csharp
  82. public abstract float TypicalP { get; set; }
  83. ```
  84. #### Property Value
  85. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  86. ### **Temperature**
  87. 1.0 = disabled
  88. ```csharp
  89. public abstract float Temperature { get; set; }
  90. ```
  91. #### Property Value
  92. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  93. ### **RepeatPenalty**
  94. 1.0 = disabled
  95. ```csharp
  96. public abstract float RepeatPenalty { get; set; }
  97. ```
  98. #### Property Value
  99. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  100. ### **RepeatLastTokensCount**
  101. last n tokens to penalize (0 = disable penalty, -1 = context size) (repeat_last_n)
  102. ```csharp
  103. public abstract int RepeatLastTokensCount { get; set; }
  104. ```
  105. #### Property Value
  106. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  107. ### **FrequencyPenalty**
  108. frequency penalty coefficient
  109. 0.0 = disabled
  110. ```csharp
  111. public abstract float FrequencyPenalty { get; set; }
  112. ```
  113. #### Property Value
  114. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  115. ### **PresencePenalty**
  116. presence penalty coefficient
  117. 0.0 = disabled
  118. ```csharp
  119. public abstract float PresencePenalty { get; set; }
  120. ```
  121. #### Property Value
  122. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  123. ### **Mirostat**
  124. Mirostat uses tokens instead of words.
  125. algorithm described in the paper https://arxiv.org/abs/2007.14966.
  126. 0 = disabled, 1 = mirostat, 2 = mirostat 2.0
  127. ```csharp
  128. public abstract MirostatType Mirostat { get; set; }
  129. ```
  130. #### Property Value
  131. [MirostatType](./llama.common.mirostattype.md)<br>
  132. ### **MirostatTau**
  133. target entropy
  134. ```csharp
  135. public abstract float MirostatTau { get; set; }
  136. ```
  137. #### Property Value
  138. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  139. ### **MirostatEta**
  140. learning rate
  141. ```csharp
  142. public abstract float MirostatEta { get; set; }
  143. ```
  144. #### Property Value
  145. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  146. ### **PenalizeNL**
  147. consider newlines as a repeatable token (penalize_nl)
  148. ```csharp
  149. public abstract bool PenalizeNL { get; set; }
  150. ```
  151. #### Property Value
  152. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  153. ### **Grammar**
  154. Grammar to constrain possible tokens
  155. ```csharp
  156. public abstract SafeLLamaGrammarHandle Grammar { get; set; }
  157. ```
  158. #### Property Value
  159. [SafeLLamaGrammarHandle](./llama.native.safellamagrammarhandle.md)<br>