use same GGUF_GET_KEY macro as in llama.cpp

This commit is contained in:
xaedes 2023-08-27 23:32:49 +02:00
parent d71069c4fb
commit 91a4ccaf96
No known key found for this signature in database
GPG key ID: 30030EDD817EA2B1

View file

@ -1492,11 +1492,11 @@ void set_logits_masked(struct ggml_tensor * logits, std::vector<bool>& 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())); \
} \
}