throw exception inside llama_model_loader

Co-authored-by: slaren <slarengh@gmail.com>
This commit is contained in:
Xuan Son Nguyen 2024-04-28 11:16:34 +02:00 committed by GitHub
parent 2df79ff950
commit b1df2f212e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3118,7 +3118,7 @@ struct llama_model_loader {
const std::string name(w.tensor->name);
auto found = tensor_names.find(name);
if (found != tensor_names.end()) {
LLAMA_LOG_ERROR("%s: Found duplicated tensor name %s", __func__, w.tensor->name);
throw std::runtime_error(format("invalid model: tensor '%s' is duplicated", w.tensor->name));
}
tensor_names.insert(name);
}