MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / gguf_find_key

Function gguf_find_key

ggml.c:19838–19852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19836}
19837
19838int gguf_find_key(const struct gguf_context * ctx, const char * key) {
19839 // return -1 if key not found
19840 int keyfound = -1;
19841
19842 const int n_kv = gguf_get_n_kv(ctx);
19843
19844 for (int i = 0; i < n_kv; ++i) {
19845 if (strcmp(key, gguf_get_key(ctx, i)) == 0) {
19846 keyfound = i;
19847 break;
19848 }
19849 }
19850
19851 return keyfound;
19852}
19853
19854const char * gguf_get_key(const struct gguf_context * ctx, int key_id) {
19855 return ctx->kv[key_id].key.data;

Callers 10

gguf_init_from_fileFunction · 0.70
gguf_get_or_add_keyFunction · 0.70
llama_model_loaderMethod · 0.70
llm_load_vocabFunction · 0.70
load_train_state_ggufFunction · 0.50
get_key_idxFunction · 0.50
clip_model_loadFunction · 0.50
save_llama_model_ggufFunction · 0.50
load_vocabFunction · 0.50
gguf_ex_read_0Function · 0.50

Calls 2

gguf_get_n_kvFunction · 0.70
gguf_get_keyFunction · 0.70

Tested by

no test coverage detected