show more meaningful error message on missing tensor
This commit is contained in:
parent
f4b088c5fa
commit
dffb032ca8
|
|
@ -2388,8 +2388,12 @@ LLM_TN_IMPL::LLM_TN_IMPL(llm_arch arch, llm_tensor tensor, const char * suffix,
|
||||||
model_tensors(llm_get_tensor_names(arch)) {}
|
model_tensors(llm_get_tensor_names(arch)) {}
|
||||||
|
|
||||||
std::string LLM_TN_IMPL::str() const {
|
std::string LLM_TN_IMPL::str() const {
|
||||||
|
if (LLM_TENSOR_NAMES.find(tensor) == LLM_TENSOR_NAMES.end()) {
|
||||||
|
GGML_ABORT("unknown tensor name for tensor id %d", static_cast<int>(tensor));
|
||||||
|
}
|
||||||
|
|
||||||
if (model_tensors.find(tensor) == model_tensors.end()) {
|
if (model_tensors.find(tensor) == model_tensors.end()) {
|
||||||
return "__missing__";
|
return LLM_TENSOR_NAMES.at(tensor);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string name = ::format(LLM_TENSOR_NAMES.at(tensor), bid, xid);
|
std::string name = ::format(LLM_TENSOR_NAMES.at(tensor), bid, xid);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue