aboutsummaryrefslogtreecommitdiff
path: root/llama.h
diff options
context:
space:
mode:
authorEvan Jones <evan.q.jones@gmail.com>2023-04-28 11:59:37 -0400
committerGitHub <noreply@github.com>2023-04-28 18:59:37 +0300
commit1481a9cf25ea2e4abef6b13a57660a35f3e66af1 (patch)
treec2c81f8f38da358715796681811ab1faeae00229 /llama.h
parent11d902364b0e3b503a02a4e757ee2dc38aacb68f (diff)
llama : add session file format and saved sessions in main (#1169)
Diffstat (limited to 'llama.h')
-rw-r--r--llama.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/llama.h b/llama.h
index 17dac06..86a7d27 100644
--- a/llama.h
+++ b/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