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

Method get_key

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

Source from the content-addressed store, hash-verified

388
389 template<typename T>
390 bool llama_model_loader::get_key(const std::string & key, T & result, bool required) {
391 auto it = kv_overrides.find(key);
392
393 const struct llama_model_kv_override * override =
394 it != kv_overrides.end() ? &it->second : nullptr;
395
396 const bool found = GGUFMeta::GKV<T>::set(meta.get(), key, result, override);
397
398 if (required && !found) {
399 throw std::runtime_error(format("key not found in model: %s", key.c_str()));
400 }
401
402 return found;
403 }
404
405 template<typename T>
406 bool llama_model_loader::get_key(enum llm_kv kid, T & result, bool required) {

Callers 5

load_hparamsMethod · 0.80
loadMethod · 0.80
gguf_get_keyFunction · 0.80
gguf_set_kvFunction · 0.80
writeMethod · 0.80

Calls 6

setFunction · 0.85
formatFunction · 0.85
llm_kvEnum · 0.70
findMethod · 0.65
getMethod · 0.65
endMethod · 0.45

Tested by

no test coverage detected