From 16bc66d9479edd5ee12ec734973554d4493c5dfa Mon Sep 17 00:00:00 2001 From: slaren Date: Thu, 28 Sep 2023 21:42:38 +0200 Subject: 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 --- common/train.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'common/train.cpp') diff --git a/common/train.cpp b/common/train.cpp index 4a128096..35a4cf9e 100644 --- a/common/train.cpp +++ b/common/train.cpp @@ -858,7 +858,7 @@ size_t tokenize_file( out_tokens.resize(buf.size() + n_max_tokens_overhead); int n_tokens = llama_tokenize( - lctx, + llama_get_model(lctx), buf.data(), (int) buf.size(), out_tokens.data(), @@ -867,7 +867,7 @@ size_t tokenize_file( if (n_tokens < 0) { out_tokens.resize(-n_tokens); n_tokens = llama_tokenize( - lctx, + llama_get_model(lctx), buf.data(), (int) buf.size(), out_tokens.data(), @@ -920,7 +920,7 @@ size_t tokenize_file( size_t found_max_sample_size = 0; size_t max_token_text_size = 0; - int n_vocab = llama_n_vocab(lctx); + int n_vocab = llama_n_vocab(llama_get_model(lctx)); for (llama_token token=0; token < n_vocab; ++token) { max_token_text_size = std::max( max_token_text_size, @@ -961,7 +961,7 @@ size_t tokenize_file( // tokenize the sample tok_sample.resize(buf_sample.size() + n_max_tokens_overhead); - int n_tokens = llama_tokenize(lctx, + int n_tokens = llama_tokenize(llama_get_model(lctx), buf_sample.data(), (int) buf_sample.size(), tok_sample.data(), @@ -969,7 +969,7 @@ size_t tokenize_file( false); if (n_tokens < 0) { tok_sample.resize(-n_tokens); - n_tokens = llama_tokenize(lctx, + n_tokens = llama_tokenize(llama_get_model(lctx), buf_sample.data(), (int) buf_sample.size(), tok_sample.data(), -- cgit v1.2.3