|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369 |
- # LLamaModelV1
-
- Namespace: LLama
-
- #### Caution
-
- This type is obsolete.
-
- ---
-
- ```csharp
- public class LLamaModelV1
- ```
-
- Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [LLamaModelV1](./llama.llamamodelv1.md)
-
- ## Constructors
-
- ### **LLamaModelV1(String, Int32, Int32, Int32, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Int32, Int32, Int32, String, String, Boolean)**
-
- ```csharp
- public LLamaModelV1(string model_path, int n_ctx, int n_parts, int seed, bool f16_kv, bool logits_all, bool vocab_only, bool use_mmap, bool use_mlock, bool embedding, int n_threads, int n_batch, int last_n_tokens_size, string lora_base, string lora_path, bool verbose)
- ```
-
- #### Parameters
-
- `model_path` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- `n_ctx` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- `n_parts` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- `seed` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- `f16_kv` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
-
- `logits_all` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
-
- `vocab_only` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
-
- `use_mmap` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
-
- `use_mlock` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
-
- `embedding` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
-
- `n_threads` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- `n_batch` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- `last_n_tokens_size` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- `lora_base` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- `lora_path` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- `verbose` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
-
- ### **LLamaModelV1(LLamaModelV1)**
-
- ```csharp
- public LLamaModelV1(LLamaModelV1 other)
- ```
-
- #### Parameters
-
- `other` [LLamaModelV1](./llama.llamamodelv1.md)<br>
-
- ## Methods
-
- ### **Tokenize(String)**
-
- ```csharp
- public List<int> Tokenize(string text)
- ```
-
- #### Parameters
-
- `text` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- #### Returns
-
- [List<Int32>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1)<br>
-
- ### **DeTokenize(IEnumerable<Int32>)**
-
- ```csharp
- public string DeTokenize(IEnumerable<int> tokens)
- ```
-
- #### Parameters
-
- `tokens` [IEnumerable<Int32>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)<br>
-
- #### Returns
-
- [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- ### **DeTokenize(Int32)**
-
- ```csharp
- public string DeTokenize(int token)
- ```
-
- #### Parameters
-
- `token` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- #### Returns
-
- [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- ### **SetCache(LLamaCache)**
-
- ```csharp
- public void SetCache(LLamaCache cache)
- ```
-
- #### Parameters
-
- `cache` [LLamaCache](./llama.llamacache.md)<br>
-
- ### **Reset()**
-
- ```csharp
- public void Reset()
- ```
-
- ### **Eval(List<Int32>)**
-
- ```csharp
- public void Eval(List<int> tokens)
- ```
-
- #### Parameters
-
- `tokens` [List<Int32>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1)<br>
-
- ### **Sample(Int32, Single, Single, Single, Single, Single)**
-
- ```csharp
- public int Sample(int top_k, float top_p, float temp, float repeat_penalty, float frequency_penalty, float presence_penalty)
- ```
-
- #### Parameters
-
- `top_k` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- `top_p` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `temp` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `repeat_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `frequency_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `presence_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- #### Returns
-
- [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- ### **Generate(IEnumerable<Int32>, Int32, Single, Single, Single, Single, Single, Boolean)**
-
- ```csharp
- public IEnumerable<int> Generate(IEnumerable<int> tokens, int top_k, float top_p, float temp, float repeat_penalty, float frequency_penalty, float presence_penalty, bool reset)
- ```
-
- #### Parameters
-
- `tokens` [IEnumerable<Int32>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)<br>
-
- `top_k` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- `top_p` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `temp` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `repeat_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `frequency_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `presence_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `reset` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
-
- #### Returns
-
- [IEnumerable<Int32>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)<br>
-
- ### **CreateEmbedding(String)**
-
- ```csharp
- public Embedding CreateEmbedding(string input)
- ```
-
- #### Parameters
-
- `input` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- #### Returns
-
- [Embedding](./llama.types.embedding.md)<br>
-
- ### **Embed(String)**
-
- ```csharp
- public Single[] Embed(string input)
- ```
-
- #### Parameters
-
- `input` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- #### Returns
-
- [Single[]](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- ### **CreateCompletion(String, String, Int32, Single, Single, Int32, Boolean, String[], Single, Single, Single, Int32)**
-
- ```csharp
- public IEnumerable<CompletionChunk> CreateCompletion(string prompt, string suffix, int max_tokens, float temperature, float top_p, int logprobs, bool echo, String[] stop, float frequency_penalty, float presence_penalty, float repeat_penalty, int top_k)
- ```
-
- #### Parameters
-
- `prompt` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- `suffix` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- `max_tokens` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- `temperature` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `top_p` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `logprobs` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- `echo` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
-
- `stop` [String[]](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- `frequency_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `presence_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `repeat_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `top_k` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- #### Returns
-
- [IEnumerable<CompletionChunk>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)<br>
-
- ### **Call(String, String, Int32, Single, Single, Int32, Boolean, String[], Single, Single, Single, Int32)**
-
- ```csharp
- public IEnumerable<CompletionChunk> Call(string prompt, string suffix, int max_tokens, float temperature, float top_p, int logprobs, bool echo, String[] stop, float frequency_penalty, float presence_penalty, float repeat_penalty, int top_k)
- ```
-
- #### Parameters
-
- `prompt` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- `suffix` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- `max_tokens` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- `temperature` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `top_p` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `logprobs` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- `echo` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
-
- `stop` [String[]](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- `frequency_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `presence_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `repeat_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `top_k` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- #### Returns
-
- [IEnumerable<CompletionChunk>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)<br>
-
- ### **CreateChatCompletion(IEnumerable<ChatCompletionMessage>, Single, Single, Int32, String[], Int32, Single, Single, Single)**
-
- ```csharp
- public IEnumerable<ChatCompletionChunk> CreateChatCompletion(IEnumerable<ChatCompletionMessage> messages, float temperature, float top_p, int top_k, String[] stop, int max_tokens, float presence_penalty, float frequency_penalty, float repeat_penalty)
- ```
-
- #### Parameters
-
- `messages` [IEnumerable<ChatCompletionMessage>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)<br>
-
- `temperature` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `top_p` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `top_k` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- `stop` [String[]](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- `max_tokens` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- `presence_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `frequency_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- `repeat_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- #### Returns
-
- [IEnumerable<ChatCompletionChunk>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)<br>
-
- ### **SaveState()**
-
- ```csharp
- public LLamaState SaveState()
- ```
-
- #### Returns
-
- [LLamaState](./llama.llamastate.md)<br>
-
- ### **LoadState(LLamaState)**
-
- ```csharp
- public void LoadState(LLamaState state)
- ```
-
- #### Parameters
-
- `state` [LLamaState](./llama.llamastate.md)<br>
-
- ### **LongestTokenPrefix(IEnumerable<Int32>, IEnumerable<Int32>)**
-
- ```csharp
- internal static int LongestTokenPrefix(IEnumerable<int> a, IEnumerable<int> b)
- ```
-
- #### Parameters
-
- `a` [IEnumerable<Int32>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)<br>
-
- `b` [IEnumerable<Int32>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)<br>
-
- #### Returns
-
- [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- ### **<CreateChatCompletion>g__GetRole|31_0(ChatCompletionMessage)**
-
- ```csharp
- internal static string <CreateChatCompletion>g__GetRole|31_0(ChatCompletionMessage message)
- ```
-
- #### Parameters
-
- `message` [ChatCompletionMessage](./llama.types.chatcompletionmessage.md)<br>
-
- #### Returns
-
- [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
|