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.native.llamacontextparams.md 2.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. # LLamaContextParams
  2. Namespace: LLama.Native
  3. A C# representation of the llama.cpp `llama_context_params` struct
  4. ```csharp
  5. public struct LLamaContextParams
  6. ```
  7. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [ValueType](https://docs.microsoft.com/en-us/dotnet/api/system.valuetype) → [LLamaContextParams](./llama.native.llamacontextparams.md)
  8. ## Fields
  9. ### **seed**
  10. RNG seed, -1 for random
  11. ```csharp
  12. public uint seed;
  13. ```
  14. ### **n_ctx**
  15. text context, 0 = from model
  16. ```csharp
  17. public uint n_ctx;
  18. ```
  19. ### **n_batch**
  20. prompt processing batch size
  21. ```csharp
  22. public uint n_batch;
  23. ```
  24. ### **n_threads**
  25. number of threads to use for generation
  26. ```csharp
  27. public uint n_threads;
  28. ```
  29. ### **n_threads_batch**
  30. number of threads to use for batch processing
  31. ```csharp
  32. public uint n_threads_batch;
  33. ```
  34. ### **rope_scaling_type**
  35. RoPE scaling type, from `enum llama_rope_scaling_type`
  36. ```csharp
  37. public RopeScalingType rope_scaling_type;
  38. ```
  39. ### **rope_freq_base**
  40. RoPE base frequency, 0 = from model
  41. ```csharp
  42. public float rope_freq_base;
  43. ```
  44. ### **rope_freq_scale**
  45. RoPE frequency scaling factor, 0 = from model
  46. ```csharp
  47. public float rope_freq_scale;
  48. ```
  49. ### **yarn_ext_factor**
  50. YaRN extrapolation mix factor, negative = from model
  51. ```csharp
  52. public float yarn_ext_factor;
  53. ```
  54. ### **yarn_attn_factor**
  55. YaRN magnitude scaling factor
  56. ```csharp
  57. public float yarn_attn_factor;
  58. ```
  59. ### **yarn_beta_fast**
  60. YaRN low correction dim
  61. ```csharp
  62. public float yarn_beta_fast;
  63. ```
  64. ### **yarn_beta_slow**
  65. YaRN high correction dim
  66. ```csharp
  67. public float yarn_beta_slow;
  68. ```
  69. ### **yarn_orig_ctx**
  70. YaRN original context size
  71. ```csharp
  72. public uint yarn_orig_ctx;
  73. ```
  74. ### **defrag_threshold**
  75. defragment the KV cache if holes/size > defrag_threshold, Set to < 0 to disable (default)
  76. ```csharp
  77. public float defrag_threshold;
  78. ```
  79. ### **cb_eval**
  80. ggml_backend_sched_eval_callback
  81. ```csharp
  82. public IntPtr cb_eval;
  83. ```
  84. ### **cb_eval_user_data**
  85. User data passed into cb_eval
  86. ```csharp
  87. public IntPtr cb_eval_user_data;
  88. ```
  89. ### **type_k**
  90. data type for K cache
  91. ```csharp
  92. public GGMLType type_k;
  93. ```
  94. ### **type_v**
  95. data type for V cache
  96. ```csharp
  97. public GGMLType type_v;
  98. ```
  99. ## Properties
  100. ### **embedding**
  101. embedding mode only
  102. ```csharp
  103. public bool embedding { get; set; }
  104. ```
  105. #### Property Value
  106. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  107. ### **offload_kqv**
  108. whether to offload the KQV ops (including the KV cache) to GPU
  109. ```csharp
  110. public bool offload_kqv { get; set; }
  111. ```
  112. #### Property Value
  113. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  114. ### **do_pooling**
  115. Whether to pool (sum) embedding results by sequence id (ignored if no pooling layer)
  116. ```csharp
  117. public bool do_pooling { get; set; }
  118. ```
  119. #### Property Value
  120. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>