summaryrefslogtreecommitdiff
path: root/examples/train-text-from-scratch/train-text-from-scratch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/train-text-from-scratch/train-text-from-scratch.cpp')
-rw-r--r--examples/train-text-from-scratch/train-text-from-scratch.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/train-text-from-scratch/train-text-from-scratch.cpp b/examples/train-text-from-scratch/train-text-from-scratch.cpp
index d5205aff..a9cf8a38 100644
--- a/examples/train-text-from-scratch/train-text-from-scratch.cpp
+++ b/examples/train-text-from-scratch/train-text-from-scratch.cpp
@@ -976,14 +976,16 @@ 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 = true;
+ struct llama_model_params mparams = llama_model_default_params();
+ mparams.vocab_only = true;
- struct llama_model * lmodel = llama_load_model_from_file(params.fn_vocab_model, llama_params);
- struct llama_context * lctx = llama_new_context_with_model(lmodel, llama_params);
+ struct llama_context_params cparams = llama_context_default_params();
+
+ struct llama_model * lmodel = llama_load_model_from_file(params.fn_vocab_model, mparams);
+ struct llama_context * lctx = llama_new_context_with_model(lmodel, cparams);
struct my_llama_model model;
- model.hparams.n_vocab = llama_n_vocab(lctx);
+ model.hparams.n_vocab = llama_n_vocab(lmodel);
model.hparams.n_ctx = params.common.n_ctx;
model.hparams.n_embd = params.n_embd;
model.hparams.n_head = params.n_head;