From 57eaadb853dd03e674104f6eda9e177cfeb0cf47 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Thu, 17 Aug 2023 21:31:52 +0300 Subject: [PATCH] llama : throw error if gguf fails to init from file ggml-ci --- llama.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llama.cpp b/llama.cpp index 44ff5e43a..b0d23abbe 100644 --- a/llama.cpp +++ b/llama.cpp @@ -1042,6 +1042,9 @@ struct llama_model_loader { }; ctx_gguf = gguf_init_from_file(fname.c_str(), params); + if (!ctx_gguf) { + throw std::runtime_error(format("%s: failed to load model from %s\n", __func__, fname.c_str())); + } n_kv = gguf_get_n_kv(ctx_gguf); n_tensors = gguf_get_n_tensors(ctx_gguf);