fix missing non-required tensors falling back to type f32
This commit is contained in:
parent
9037b78263
commit
b7870ef6b8
|
|
@ -1215,6 +1215,10 @@ struct ggml_tensor * llama_model_loader::create_tensor(
|
|||
const int64_t tid = gguf_find_tensor(metadata, tn.str().c_str());
|
||||
if (tid != -1) {
|
||||
type = gguf_get_tensor_type(metadata, tid);
|
||||
} else if (flags & TENSOR_NOT_REQUIRED) {
|
||||
// If the tensor is not found and not required, return nullptr to allow
|
||||
// the caller to fall back
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// for tensors that are not required some of the dimensions can be invalid:
|
||||
|
|
|
|||
Loading…
Reference in New Issue