summaryrefslogtreecommitdiff
path: root/examples/finetune/finetune.cpp
diff options
context:
space:
mode:
authorslaren <slarengh@gmail.com>2023-09-28 21:42:38 +0200
committerGitHub <noreply@github.com>2023-09-28 22:42:38 +0300
commit16bc66d9479edd5ee12ec734973554d4493c5dfa (patch)
tree4cca787ebd86dd55fd176d27112117c74e9b34c6 /examples/finetune/finetune.cpp
parent0512d66670de3f650c579519833c085014b0f200 (diff)
llama.cpp : split llama_context_params into model and context params (#3301)
* llama.cpp : split llama_context_params into model and context params ggml-ci * fix metal build * fix freq_base/scale default to model value * llama-bench : keep the same model between tests when possible * move n_threads to llama_context_params, add n_threads_batch * fix mpi build * remove kv_size(), cuda scratch fixes * remove low-vram option * add n_threads_batch to system info, refactor to get_system_info() * add documentation about --threads-batch to the READMEs * llama-bench fix * main : fix rope freq/scale warning * llama.cpp : add llama_get_model common : add llama_tokenize from model * remove duplicated ctx/model functions ggml-ci * cuda : print total VRAM used
Diffstat (limited to 'examples/finetune/finetune.cpp')
-rw-r--r--examples/finetune/finetune.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/finetune/finetune.cpp b/examples/finetune/finetune.cpp
index 6e29e1c1..b61165fb 100644
--- a/examples/finetune/finetune.cpp
+++ b/examples/finetune/finetune.cpp
@@ -304,7 +304,7 @@ static void init_model(struct llama_model * input, struct my_llama_model * model
gguf_free(mctx);
}
- hparams.n_vocab = llama_model_n_vocab(input);
+ hparams.n_vocab = llama_n_vocab(input);
hparams.n_ctx = n_ctx;
// get tensors from llama_model (possibly mmapped)
@@ -1540,12 +1540,14 @@ int main(int argc, char ** argv) {
printf("%s: seed: %u\n", __func__, params.common.seed);
srand(params.common.seed);
- struct llama_context_params llama_params = llama_context_default_params();
- llama_params.vocab_only = false;
+ struct llama_model_params llama_mparams = llama_model_default_params();
+ llama_mparams.vocab_only = false;
printf("%s: model base = '%s'\n", __func__, params.fn_model_base);
- struct llama_model * lmodel = llama_load_model_from_file(params.fn_model_base, llama_params);
- struct llama_context * lctx = llama_new_context_with_model(lmodel, llama_params);
+ struct llama_model * lmodel = llama_load_model_from_file(params.fn_model_base, llama_mparams);
+
+ struct llama_context_params llama_cparams = llama_context_default_params();
+ struct llama_context * lctx = llama_new_context_with_model(lmodel, llama_cparams);
struct my_llama_model model;
init_model(lmodel, &model, params.fn_model_base, params.common.n_ctx);