model-loader : skip TENSOR_SKIP tensors in the metadata-only path

create_tensor asserts on a null buffer type when building from metadata
alone, but buft_for_tensor returns null by design for tensors marked
TENSOR_SKIP, which is how architectures with nextn/MTP layers mark theirs.
Those models cannot be constructed by llama_model_init_from_user at all.

The file-backed path below already returns nullptr for the same tensors, so
callers see the same thing either way.
This commit is contained in:
Junmo Kim
2026-08-10 21:28:19 +09:00
parent 56505fdad5
commit aecb9bc0c7
+1 -1
View File
@@ -1225,7 +1225,7 @@ struct ggml_tensor * llama_model_loader::create_tensor(
};
if (files.empty()) {
if (flags & TENSOR_SKIP_IF_VIRTUAL) {
if (flags & (TENSOR_SKIP_IF_VIRTUAL | TENSOR_SKIP)) {
return nullptr;
}
ggml_type type = GGML_TYPE_F32;