MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / gguf_find_key

Function gguf_find_key

external/ggml/src/gguf.cpp:888–902  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

886}
887
888int64_t gguf_find_key(const struct gguf_context * ctx, const char * key) {
889 // return -1 if key not found
890 int64_t keyfound = -1;
891
892 const int64_t n_kv = gguf_get_n_kv(ctx);
893
894 for (int64_t i = 0; i < n_kv; ++i) {
895 if (strcmp(key, gguf_get_key(ctx, i)) == 0) {
896 keyfound = i;
897 break;
898 }
899 }
900
901 return keyfound;
902}
903
904const char * gguf_get_key(const struct gguf_context * ctx, int64_t key_id) {
905 GGML_ASSERT(key_id >= 0 && key_id < gguf_get_n_kv(ctx));

Callers 3

gguf_init_from_file_ptrFunction · 0.85
gguf_remove_keyFunction · 0.85

Calls 2

gguf_get_n_kvFunction · 0.85
gguf_get_keyFunction · 0.85

Tested by

no test coverage detected