summaryrefslogtreecommitdiff
path: root/llama.h
diff options
context:
space:
mode:
Diffstat (limited to 'llama.h')
-rw-r--r--llama.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/llama.h b/llama.h
index 57123dbc..827abc1f 100644
--- a/llama.h
+++ b/llama.h
@@ -45,6 +45,8 @@ extern "C" {
} llama_token_data;
+ typedef void (*llama_progress_callback)(double progress, void *ctx);
+
struct llama_context_params {
int n_ctx; // text context
int n_parts; // -1 for default
@@ -55,6 +57,11 @@ extern "C" {
bool vocab_only; // only load the vocabulary, no weights
bool use_mlock; // force system to keep model in RAM
bool embedding; // embedding mode only
+
+ // called with a progress value between 0 and 1, pass NULL to disable
+ llama_progress_callback progress_callback;
+ // context pointer passed to the progress callback
+ void * progress_callback_user_data;
};
LLAMA_API struct llama_context_params llama_context_default_params();