MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / gguf_find_key

Function gguf_find_key

subprojects/llama.cpp/ggml/src/gguf.cpp:782–796  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

780}
781
782int64_t gguf_find_key(const struct gguf_context * ctx, const char * key) {
783 // return -1 if key not found
784 int64_t keyfound = -1;
785
786 const int64_t n_kv = gguf_get_n_kv(ctx);
787
788 for (int64_t i = 0; i < n_kv; ++i) {
789 if (strcmp(key, gguf_get_key(ctx, i)) == 0) {
790 keyfound = i;
791 break;
792 }
793 }
794
795 return keyfound;
796}
797
798const char * gguf_get_key(const struct gguf_context * ctx, int64_t key_id) {
799 GGML_ASSERT(key_id >= 0 && key_id < gguf_get_n_kv(ctx));

Callers 15

get_kv_strFunction · 0.85
get_kv_f32Function · 0.85
lora_merge_ctxMethod · 0.85
load_hparamsMethod · 0.85
get_boolMethod · 0.85
get_i32Method · 0.85
get_u32Method · 0.85
get_f32Method · 0.85
get_stringMethod · 0.85
get_arr_intMethod · 0.85
load_imatrixFunction · 0.85
gguf_mergeFunction · 0.85

Calls 2

gguf_get_n_kvFunction · 0.85
gguf_get_keyFunction · 0.85

Tested by 3

handcrafted_check_kvFunction · 0.68
all_kv_in_otherFunction · 0.68