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

Function gguf_set_arr_data

external/ggml/src/gguf.cpp:1155–1166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1153}
1154
1155void gguf_set_arr_data(struct gguf_context * ctx, const char * key, enum gguf_type type, const void * data, size_t n) {
1156 gguf_check_reserved_keys(key, data);
1157 gguf_remove_key(ctx, key);
1158
1159 const size_t nbytes = n*gguf_type_size(type);
1160 std::vector<int8_t> tmp(nbytes);
1161 if (!tmp.empty()) {
1162 memcpy(tmp.data(), data, nbytes);
1163 }
1164 ctx->kv.emplace_back(key, tmp);
1165 ctx->kv.back().cast(type);
1166}
1167
1168void gguf_set_arr_str(struct gguf_context * ctx, const char * key, const char ** data, size_t n) {
1169 gguf_check_reserved_keys(key, data);

Callers 1

gguf_set_kvFunction · 0.85

Calls 6

gguf_check_reserved_keysFunction · 0.85
gguf_remove_keyFunction · 0.85
gguf_type_sizeFunction · 0.85
castMethod · 0.80
emptyMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected