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.icontextparams.md 5.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. # IContextParams
  2. Namespace: LLama.Abstractions
  3. The parameters for initializing a LLama context from a model.
  4. ```csharp
  5. public interface IContextParams
  6. ```
  7. ## Properties
  8. ### **ContextSize**
  9. Model context size (n_ctx)
  10. ```csharp
  11. public abstract Nullable<uint> ContextSize { get; }
  12. ```
  13. #### Property Value
  14. [Nullable&lt;UInt32&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  15. ### **BatchSize**
  16. batch size for prompt processing (must be &gt;=32 to use BLAS) (n_batch)
  17. ```csharp
  18. public abstract uint BatchSize { get; }
  19. ```
  20. #### Property Value
  21. [UInt32](https://docs.microsoft.com/en-us/dotnet/api/system.uint32)<br>
  22. ### **Seed**
  23. Seed for the random number generator (seed)
  24. ```csharp
  25. public abstract uint Seed { get; }
  26. ```
  27. #### Property Value
  28. [UInt32](https://docs.microsoft.com/en-us/dotnet/api/system.uint32)<br>
  29. ### **EmbeddingMode**
  30. Whether to use embedding mode. (embedding) Note that if this is set to true,
  31. The LLamaModel won't produce text response anymore.
  32. ```csharp
  33. public abstract bool EmbeddingMode { get; }
  34. ```
  35. #### Property Value
  36. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  37. ### **RopeFrequencyBase**
  38. RoPE base frequency (null to fetch from the model)
  39. ```csharp
  40. public abstract Nullable<float> RopeFrequencyBase { get; }
  41. ```
  42. #### Property Value
  43. [Nullable&lt;Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  44. ### **RopeFrequencyScale**
  45. RoPE frequency scaling factor (null to fetch from the model)
  46. ```csharp
  47. public abstract Nullable<float> RopeFrequencyScale { get; }
  48. ```
  49. #### Property Value
  50. [Nullable&lt;Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  51. ### **Encoding**
  52. The encoding to use for models
  53. ```csharp
  54. public abstract Encoding Encoding { get; }
  55. ```
  56. #### Property Value
  57. [Encoding](https://docs.microsoft.com/en-us/dotnet/api/system.text.encoding)<br>
  58. ### **Threads**
  59. Number of threads (null = autodetect) (n_threads)
  60. ```csharp
  61. public abstract Nullable<uint> Threads { get; }
  62. ```
  63. #### Property Value
  64. [Nullable&lt;UInt32&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  65. ### **BatchThreads**
  66. Number of threads to use for batch processing (null = autodetect) (n_threads)
  67. ```csharp
  68. public abstract Nullable<uint> BatchThreads { get; }
  69. ```
  70. #### Property Value
  71. [Nullable&lt;UInt32&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  72. ### **YarnExtrapolationFactor**
  73. YaRN extrapolation mix factor (null = from model)
  74. ```csharp
  75. public abstract Nullable<float> YarnExtrapolationFactor { get; }
  76. ```
  77. #### Property Value
  78. [Nullable&lt;Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  79. ### **YarnAttentionFactor**
  80. YaRN magnitude scaling factor (null = from model)
  81. ```csharp
  82. public abstract Nullable<float> YarnAttentionFactor { get; }
  83. ```
  84. #### Property Value
  85. [Nullable&lt;Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  86. ### **YarnBetaFast**
  87. YaRN low correction dim (null = from model)
  88. ```csharp
  89. public abstract Nullable<float> YarnBetaFast { get; }
  90. ```
  91. #### Property Value
  92. [Nullable&lt;Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  93. ### **YarnBetaSlow**
  94. YaRN high correction dim (null = from model)
  95. ```csharp
  96. public abstract Nullable<float> YarnBetaSlow { get; }
  97. ```
  98. #### Property Value
  99. [Nullable&lt;Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  100. ### **YarnOriginalContext**
  101. YaRN original context length (null = from model)
  102. ```csharp
  103. public abstract Nullable<uint> YarnOriginalContext { get; }
  104. ```
  105. #### Property Value
  106. [Nullable&lt;UInt32&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  107. ### **YarnScalingType**
  108. YaRN scaling method to use.
  109. ```csharp
  110. public abstract Nullable<RopeScalingType> YarnScalingType { get; }
  111. ```
  112. #### Property Value
  113. [Nullable&lt;RopeScalingType&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  114. ### **TypeK**
  115. Override the type of the K cache
  116. ```csharp
  117. public abstract Nullable<GGMLType> TypeK { get; }
  118. ```
  119. #### Property Value
  120. [Nullable&lt;GGMLType&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  121. ### **TypeV**
  122. Override the type of the V cache
  123. ```csharp
  124. public abstract Nullable<GGMLType> TypeV { get; }
  125. ```
  126. #### Property Value
  127. [Nullable&lt;GGMLType&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.nullable-1)<br>
  128. ### **NoKqvOffload**
  129. Whether to disable offloading the KQV cache to the GPU
  130. ```csharp
  131. public abstract bool NoKqvOffload { get; }
  132. ```
  133. #### Property Value
  134. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  135. ### **DefragThreshold**
  136. defragment the KV cache if holes/size &gt; defrag_threshold, Set to &lt; 0 to disable (default)
  137. ```csharp
  138. public abstract float DefragThreshold { get; }
  139. ```
  140. #### Property Value
  141. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  142. ### **DoPooling**
  143. Whether to pool (sum) embedding results by sequence id (ignored if no pooling layer)
  144. ```csharp
  145. public abstract bool DoPooling { get; }
  146. ```
  147. #### Property Value
  148. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>