Namespace: LLama
This type is obsolete.
public class LLamaModelV1
Inheritance Object → LLamaModelV1
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)
model_path String
n_ctx Int32
n_parts Int32
seed Int32
f16_kv Boolean
logits_all Boolean
vocab_only Boolean
use_mmap Boolean
use_mlock Boolean
embedding Boolean
n_threads Int32
n_batch Int32
last_n_tokens_size Int32
lora_base String
lora_path String
verbose Boolean
public LLamaModelV1(LLamaModelV1 other)
other LLamaModelV1
public List<int> Tokenize(string text)
text String
public string DeTokenize(IEnumerable<int> tokens)
tokens IEnumerable<Int32>
public string DeTokenize(int token)
token Int32
public void SetCache(LLamaCache cache)
cache LLamaCache
public void Reset()
public void Eval(List<int> tokens)
tokens List<Int32>
public int Sample(int top_k, float top_p, float temp, float repeat_penalty, float frequency_penalty, float presence_penalty)
top_k Int32
top_p Single
temp Single
repeat_penalty Single
frequency_penalty Single
presence_penalty Single
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)
tokens IEnumerable<Int32>
top_k Int32
top_p Single
temp Single
repeat_penalty Single
frequency_penalty Single
presence_penalty Single
reset Boolean
public Embedding CreateEmbedding(string input)
input String
public Single[] Embed(string input)
input String
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)
prompt String
suffix String
max_tokens Int32
temperature Single
top_p Single
logprobs Int32
echo Boolean
stop String[]
frequency_penalty Single
presence_penalty Single
repeat_penalty Single
top_k Int32
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)
prompt String
suffix String
max_tokens Int32
temperature Single
top_p Single
logprobs Int32
echo Boolean
stop String[]
frequency_penalty Single
presence_penalty Single
repeat_penalty Single
top_k Int32
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)
messages IEnumerable<ChatCompletionMessage>
temperature Single
top_p Single
top_k Int32
stop String[]
max_tokens Int32
presence_penalty Single
frequency_penalty Single
repeat_penalty Single
IEnumerable<ChatCompletionChunk>
public LLamaState SaveState()
public void LoadState(LLamaState state)
state LLamaState
internal static int LongestTokenPrefix(IEnumerable<int> a, IEnumerable<int> b)
internal static string <CreateChatCompletion>g__GetRole|31_0(ChatCompletionMessage message)
message ChatCompletionMessage