@@ -1396,14 +1396,16 @@ struct clip_ctx * clip_init(const char * fname, struct clip_context_params ctx_p
1396
1396
const int n_kv = gguf_get_n_kv (ctx);
1397
1397
const int ftype = get_u32 (ctx, KEY_FTYPE);
1398
1398
const std::string ftype_str = get_ftype (ftype);
1399
- const int idx_desc = get_key_idx (ctx, KEY_DESCRIPTION);
1400
- const std::string description = gguf_get_val_str (ctx, idx_desc);
1401
1399
const int idx_name = gguf_find_key (ctx, KEY_NAME);
1402
1400
if (idx_name != -1 ) { // make name optional temporarily as some of the uploaded models missing it due to a bug
1403
1401
const std::string name = gguf_get_val_str (ctx, idx_name);
1404
1402
LOG_INF (" %s: model name: %s\n " , __func__, name.c_str ());
1405
1403
}
1406
- LOG_INF (" %s: description: %s\n " , __func__, description.c_str ());
1404
+ const int idx_desc = get_key_idx (ctx, KEY_DESCRIPTION);
1405
+ if (idx_desc != -1 ) { // ditto
1406
+ const std::string description = gguf_get_val_str (ctx, idx_desc);
1407
+ LOG_INF (" %s: description: %s\n " , __func__, description.c_str ());
1408
+ }
1407
1409
LOG_INF (" %s: GGUF version: %d\n " , __func__, gguf_get_version (ctx));
1408
1410
LOG_INF (" %s: alignment: %zu\n " , __func__, gguf_get_alignment (ctx));
1409
1411
LOG_INF (" %s: n_tensors: %d\n " , __func__, n_tensors);
0 commit comments