From 91a4ccaf96cc0c369f11c8dda83648aef4ba1cbf Mon Sep 17 00:00:00 2001 From: xaedes Date: Sun, 27 Aug 2023 23:32:49 +0200 Subject: [PATCH] use same GGUF_GET_KEY macro as in llama.cpp --- examples/train-text-from-scratch/train-text-from-scratch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/train-text-from-scratch/train-text-from-scratch.cpp b/examples/train-text-from-scratch/train-text-from-scratch.cpp index 546a16c97..88439cfe3 100644 --- a/examples/train-text-from-scratch/train-text-from-scratch.cpp +++ b/examples/train-text-from-scratch/train-text-from-scratch.cpp @@ -1492,11 +1492,11 @@ void set_logits_masked(struct ggml_tensor * logits, std::vector& mask, flo if (kid >= 0) { \ enum gguf_type ktype = gguf_get_kv_type(ctx, kid); \ if (ktype != (type)) { \ - throw std::runtime_error("key has wrong type"); \ + throw std::runtime_error(format("key %s has wrong type: %s", skey.c_str(), gguf_type_name(ktype))); \ } \ (dst) = func(ctx, kid); \ } else if (req) { \ - throw std::runtime_error("key not found in model"); \ + throw std::runtime_error(format("key not found in model: %s", skey.c_str())); \ } \ }