Skip to content

Commit 63da54e

Browse files
committed
Only attempt to use mmap for the lora base model if it is supported
1 parent 3df343b commit 63da54e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llama.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1840,7 +1840,9 @@ int llama_apply_lora_from_file_internal(struct llama_context * ctx, const char *
18401840
model_loader->ggml_ctx = base_ctx;
18411841

18421842
// maybe this should in llama_model_loader
1843-
model_loader->mapping.reset(new llama_mmap(&model_loader->file_loaders.at(0)->file, false));
1843+
if (model_loader->use_mmap) {
1844+
model_loader->mapping.reset(new llama_mmap(&model_loader->file_loaders.at(0)->file, /* prefetch */ false));
1845+
}
18441846
}
18451847

18461848
// read tensors and apply

0 commit comments

Comments
 (0)