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

Function gguf_get_arr_n

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

Source from the content-addressed store, hash-verified

824}
825
826size_t gguf_get_arr_n(const struct gguf_context * ctx, int64_t key_id) {
827 GGML_ASSERT(key_id >= 0 && key_id < gguf_get_n_kv(ctx));
828
829 if (ctx->kv[key_id].type == GGUF_TYPE_STRING) {
830 return ctx->kv[key_id].data_string.size();
831 }
832
833 const size_t type_size = gguf_type_size(ctx->kv[key_id].type);
834 GGML_ASSERT(ctx->kv[key_id].data.size() % type_size == 0);
835 return ctx->kv[key_id].data.size() / type_size;
836}
837
838uint8_t gguf_get_val_u8(const struct gguf_context * ctx, int64_t key_id) {
839 GGML_ASSERT(key_id >= 0 && key_id < gguf_get_n_kv(ctx));

Callers 12

gguf_kv_to_strFunction · 0.85
get_arr_intMethod · 0.85
load_imatrixFunction · 0.85
load_imatrixMethod · 0.85
gguf_kv_to_strFunction · 0.85
loadMethod · 0.85
getterMethod · 0.85
get_arrMethod · 0.85
llama_model_loaderMethod · 0.85
handcrafted_check_kvFunction · 0.85
all_kv_in_otherFunction · 0.85

Calls 3

gguf_get_n_kvFunction · 0.85
gguf_type_sizeFunction · 0.85
sizeMethod · 0.65

Tested by 2

handcrafted_check_kvFunction · 0.68
all_kv_in_otherFunction · 0.68