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

Method get_arr_n

subprojects/llama.cpp/src/llama-model-loader.cpp:264–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262
263 template<typename T>
264 typename std::enable_if<std::is_integral<T>::value, bool>::type
265 llama_model_loader::get_arr_n(const std::string & key, T & result, bool required) {
266 const int kid = gguf_find_key(meta.get(), key.c_str());
267
268 if (kid < 0) {
269 if (required) {
270 throw std::runtime_error(format("key not found in model: %s", key.c_str()));
271 }
272 return false;
273 }
274
275 struct GGUFMeta::ArrayInfo arr_info =
276 GGUFMeta::GKV<GGUFMeta::ArrayInfo>::get_kv(meta.get(), kid);
277
278
279 result = arr_info.length;
280 return true;
281 }
282
283 template<typename T>
284 typename std::enable_if<std::is_integral<T>::value, bool>::type

Callers 1

load_hparamsMethod · 0.80

Calls 4

gguf_find_keyFunction · 0.85
formatFunction · 0.85
llm_kvEnum · 0.70
getMethod · 0.65

Tested by

no test coverage detected