2024-09-16 22:58:55 +00:00
|
|
|
From 2cfaa0a04faa9c87ba8f1ac8527eb953e69c6cde Mon Sep 17 00:00:00 2001
|
|
|
|
From: Michael Yang <mxyng@pm.me>
|
|
|
|
Date: Mon, 16 Sep 2024 15:53:10 -0700
|
|
|
|
Subject: [PATCH] 01-load-progress.diff
|
|
|
|
|
|
|
|
---
|
|
|
|
common/common.cpp | 2 ++
|
|
|
|
common/common.h | 7 +++++++
|
|
|
|
2 files changed, 9 insertions(+)
|
|
|
|
|
2024-05-20 23:41:43 +00:00
|
|
|
diff --git a/common/common.cpp b/common/common.cpp
|
2024-09-16 22:58:55 +00:00
|
|
|
index 9fa18472..48ff41e9 100644
|
2024-05-20 23:41:43 +00:00
|
|
|
--- a/common/common.cpp
|
|
|
|
+++ b/common/common.cpp
|
2024-09-16 22:58:55 +00:00
|
|
|
@@ -2573,6 +2573,8 @@ struct llama_model_params llama_model_params_from_gpt_params(const gpt_params &
|
2024-05-20 23:41:43 +00:00
|
|
|
mparams.use_mmap = params.use_mmap;
|
|
|
|
mparams.use_mlock = params.use_mlock;
|
|
|
|
mparams.check_tensors = params.check_tensors;
|
|
|
|
+ mparams.progress_callback = params.progress_callback;
|
|
|
|
+ mparams.progress_callback_user_data = params.progress_callback_user_data;
|
|
|
|
if (params.kv_overrides.empty()) {
|
|
|
|
mparams.kv_overrides = NULL;
|
|
|
|
} else {
|
|
|
|
diff --git a/common/common.h b/common/common.h
|
2024-09-16 22:58:55 +00:00
|
|
|
index cb5e7f6d..d8f043f7 100644
|
2024-05-20 23:41:43 +00:00
|
|
|
--- a/common/common.h
|
|
|
|
+++ b/common/common.h
|
2024-09-16 22:58:55 +00:00
|
|
|
@@ -204,6 +204,13 @@ struct gpt_params {
|
2024-05-20 23:41:43 +00:00
|
|
|
std::string mmproj = ""; // path to multimodal projector
|
|
|
|
std::vector<std::string> image; // path to image file(s)
|
2024-06-17 19:56:16 +00:00
|
|
|
|
2024-05-20 23:41:43 +00:00
|
|
|
+ // Called with a progress value between 0.0 and 1.0. Pass NULL to disable.
|
|
|
|
+ // If the provided progress_callback returns true, model loading continues.
|
|
|
|
+ // If it returns false, model loading is immediately aborted.
|
|
|
|
+ llama_progress_callback progress_callback = NULL;
|
|
|
|
+ // context pointer passed to the progress callback
|
|
|
|
+ void * progress_callback_user_data;
|
2024-06-17 19:56:16 +00:00
|
|
|
+
|
2024-07-05 17:25:58 +00:00
|
|
|
// embedding
|
|
|
|
bool embedding = false; // get only sentence embedding
|
|
|
|
int32_t embd_normalize = 2; // normalisation for embendings (-1=none, 0=max absolute int16, 1=taxicab, 2=euclidean, >2=p-norm)
|
2024-09-16 22:58:55 +00:00
|
|
|
--
|
|
|
|
2.46.0
|
|
|
|
|