MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / get_key

Method get_key

smallthinker/src/llama-model-loader.cpp:356–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

354
355 template<typename T>
356 bool llama_model_loader::get_key(const std::string & key, T & result, bool required) {
357 auto it = kv_overrides.find(key);
358
359 const struct llama_model_kv_override * override =
360 it != kv_overrides.end() ? &it->second : nullptr;
361
362 const bool found = GGUFMeta::GKV<T>::set(meta.get(), key, result, override);
363
364 if (required && !found) {
365 throw std::runtime_error(format("key not found in model: %s", key.c_str()));
366 }
367
368 return found;
369 }
370
371 template<typename T>
372 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 7

findMethod · 0.80
formatFunction · 0.70
llm_kvEnum · 0.70
setFunction · 0.50
endMethod · 0.45
getMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected