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.llamamodel.md 7.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. # LLamaModel
  2. Namespace: LLama
  3. ```csharp
  4. public class LLamaModel : IChatModel
  5. ```
  6. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [LLamaModel](./llama.llamamodel.md)<br>
  7. Implements [IChatModel](./llama.ichatmodel.md)
  8. ## Properties
  9. ### **Name**
  10. ```csharp
  11. public string Name { get; set; }
  12. ```
  13. #### Property Value
  14. [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  15. ### **NativeHandle**
  16. ```csharp
  17. public SafeLLamaContextHandle NativeHandle { get; }
  18. ```
  19. #### Property Value
  20. [SafeLLamaContextHandle](./llama.native.safellamacontexthandle.md)<br>
  21. ## Constructors
  22. ### **LLamaModel(String, String, Boolean, Boolean, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Dictionary&lt;Int32, Single&gt;, Int32, Single, Single, Single, Single, Single, Int32, Single, Single, Int32, Single, Single, String, String, String, String, List&lt;String&gt;, String, String, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)**
  23. ```csharp
  24. public LLamaModel(string model_path, string model_name, bool echo_input, bool verbose, int seed, int n_threads, int n_predict, int n_parts, int n_ctx, int n_batch, int n_keep, Dictionary<int, float> logit_bias, int top_k, float top_p, float tfs_z, float typical_p, float temp, float repeat_penalty, int repeat_last_n, float frequency_penalty, float presence_penalty, int mirostat, float mirostat_tau, float mirostat_eta, string prompt, string path_session, string input_prefix, string input_suffix, List<string> antiprompt, string lora_adapter, string lora_base, bool memory_f16, bool random_prompt, bool use_color, bool interactive, bool embedding, bool interactive_first, bool instruct, bool penalize_nl, bool perplexity, bool use_mmap, bool use_mlock, bool mem_test, bool verbose_prompt)
  25. ```
  26. #### Parameters
  27. `model_path` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  28. `model_name` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  29. `echo_input` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  30. `verbose` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  31. `seed` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  32. `n_threads` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  33. `n_predict` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  34. `n_parts` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  35. `n_ctx` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  36. `n_batch` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  37. `n_keep` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  38. `logit_bias` [Dictionary&lt;Int32, Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
  39. `top_k` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  40. `top_p` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  41. `tfs_z` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  42. `typical_p` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  43. `temp` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  44. `repeat_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  45. `repeat_last_n` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  46. `frequency_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  47. `presence_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  48. `mirostat` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  49. `mirostat_tau` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  50. `mirostat_eta` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  51. `prompt` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  52. `path_session` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  53. `input_prefix` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  54. `input_suffix` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  55. `antiprompt` [List&lt;String&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1)<br>
  56. `lora_adapter` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  57. `lora_base` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  58. `memory_f16` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  59. `random_prompt` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  60. `use_color` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  61. `interactive` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  62. `embedding` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  63. `interactive_first` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  64. `instruct` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  65. `penalize_nl` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  66. `perplexity` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  67. `use_mmap` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  68. `use_mlock` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  69. `mem_test` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  70. `verbose_prompt` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  71. ### **LLamaModel(LLamaParams, String, Boolean, Boolean)**
  72. ```csharp
  73. public LLamaModel(LLamaParams params, string name, bool echo_input, bool verbose)
  74. ```
  75. #### Parameters
  76. `params` [LLamaParams](./llama.llamaparams.md)<br>
  77. `name` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  78. `echo_input` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  79. `verbose` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  80. ## Methods
  81. ### **WithPrompt(String)**
  82. ```csharp
  83. public LLamaModel WithPrompt(string prompt)
  84. ```
  85. #### Parameters
  86. `prompt` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  87. #### Returns
  88. [LLamaModel](./llama.llamamodel.md)<br>
  89. ### **WithPromptFile(String)**
  90. ```csharp
  91. public LLamaModel WithPromptFile(string promptFileName)
  92. ```
  93. #### Parameters
  94. `promptFileName` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  95. #### Returns
  96. [LLamaModel](./llama.llamamodel.md)<br>
  97. ### **InitChatPrompt(String)**
  98. ```csharp
  99. public void InitChatPrompt(string prompt)
  100. ```
  101. #### Parameters
  102. `prompt` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  103. ### **InitChatAntiprompt(String[])**
  104. ```csharp
  105. public void InitChatAntiprompt(String[] antiprompt)
  106. ```
  107. #### Parameters
  108. `antiprompt` [String[]](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  109. ### **Chat(String, String)**
  110. ```csharp
  111. public IEnumerable<string> Chat(string text, string prompt)
  112. ```
  113. #### Parameters
  114. `text` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  115. `prompt` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  116. #### Returns
  117. [IEnumerable&lt;String&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)<br>
  118. ### **Call(String)**
  119. ```csharp
  120. public IEnumerable<string> Call(string text)
  121. ```
  122. #### Parameters
  123. `text` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  124. #### Returns
  125. [IEnumerable&lt;String&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)<br>