llama : add session file format and saved sessions in main (#1169)
This commit is contained in:
parent
11d902364b
commit
1481a9cf25
6 changed files with 156 additions and 2 deletions
4
llama.h
4
llama.h
|
@ -133,6 +133,10 @@ extern "C" {
|
|||
// Returns the number of bytes read
|
||||
LLAMA_API size_t llama_set_state_data(struct llama_context * ctx, const uint8_t * src);
|
||||
|
||||
// Save/load session file
|
||||
LLAMA_API size_t llama_load_session_file(struct llama_context * ctx, const char * path_session, llama_token * tokens_out, size_t n_token_capacity, size_t * n_token_count_out);
|
||||
LLAMA_API size_t llama_save_session_file(struct llama_context * ctx, const char * path_session, const llama_token * tokens, size_t n_token_count);
|
||||
|
||||
// Run the llama inference to obtain the logits and probabilities for the next token.
|
||||
// tokens + n_tokens is the provided batch of new tokens to process
|
||||
// n_past is the number of tokens to use from previous eval calls
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue