Skip to content

Commit 73bcc5b

Browse files
committed
Remove vocab_only from constructor of llama_model_loader
1 parent d94d0ae commit 73bcc5b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llama.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ struct llama_model_loader {
576576
struct ggml_context * ggml_ctx = NULL;
577577
std::unique_ptr<llama_mmap> mapping;
578578

579-
llama_model_loader(const std::string & fname_base, bool use_mmap, bool vocab_only) {
579+
llama_model_loader(const std::string & fname_base, bool use_mmap) {
580580
file_loader = std::unique_ptr<llama_file_loader>(new llama_file_loader(fname_base.c_str(), tensors_map));
581581
if (!llama_mmap::SUPPORTED) {
582582
use_mmap = false;
@@ -921,7 +921,7 @@ static void llama_model_load_internal(
921921

922922
model.t_start_us = ggml_time_us();
923923

924-
std::unique_ptr<llama_model_loader> ml(new llama_model_loader(fname, use_mmap, vocab_only));
924+
std::unique_ptr<llama_model_loader> ml(new llama_model_loader(fname, use_mmap));
925925

926926
vocab = std::move(ml->file_loader->vocab);
927927
model.hparams = ml->file_loader->hparams;
@@ -2304,8 +2304,7 @@ static void llama_model_quantize_internal(const std::string & fname_inp, const s
23042304
nthread = std::thread::hardware_concurrency();
23052305
}
23062306

2307-
std::unique_ptr<llama_model_loader> model_loader(new llama_model_loader(fname_inp, /*use_mmap*/ false,
2308-
/*vocab_only*/ false));
2307+
std::unique_ptr<llama_model_loader> model_loader(new llama_model_loader(fname_inp, /*use_mmap*/ false));
23092308
llama_file_saver file_saver(fname_out.c_str(), model_loader->file_loader.get(), params->ftype);
23102309

23112310
#ifdef GGML_USE_K_QUANTS
@@ -2738,7 +2737,7 @@ int llama_apply_lora_from_file_internal(const struct llama_model & model, const
27382737
llama_buffer base_buf;
27392738
if (path_base_model) {
27402739
fprintf(stderr, "%s: loading base model from '%s'\n", __func__, path_base_model);
2741-
model_loader.reset(new llama_model_loader(path_base_model, /*use_mmap*/ true, /*vocab_only*/ false));
2740+
model_loader.reset(new llama_model_loader(path_base_model, /*use_mmap*/ true));
27422741

27432742
size_t ctx_size;
27442743
size_t mmapped_size;

0 commit comments

Comments
 (0)