Skip to content

Commit 3943d96

Browse files
authored
Merge branch 'ggml-org:master' into master
2 parents 4615450 + 51f311e commit 3943d96

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/llama-model.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,14 @@ bool llama_model::load_tensors(llama_model_loader & ml) {
14241424
throw std::runtime_error(format("missing tensor info mapping for %s", tn.str().c_str()));
14251425
}
14261426

1427+
// skip unused tensors
1428+
if (info.op == GGML_OP_NONE) {
1429+
LLAMA_LOG_WARN("model has unused tensor %s -- ignoring\n", tn.str().c_str());
1430+
ml.n_created++;
1431+
1432+
return nullptr;
1433+
}
1434+
14271435
// tensors with "bias" suffix are always used with GGML_OP_ADD
14281436
ggml_op op;
14291437
bool bias = tn.suffix != nullptr && strcmp(tn.suffix, "bias") == 0;

0 commit comments

Comments
 (0)