| 347 | } |
| 348 | bool Gguf::has(const std::string& key) const { return ints_.count(key) || floats_.count(key) || int_arrays_.count(key); } |
| 349 | int64_t Gguf::i(const std::string& key) const { |
| 350 | auto it = ints_.find(key); |
| 351 | if (it == ints_.end()) throw std::runtime_error("gguf: no integer key " + key); |
| 352 | return it->second; |
| 353 | } |
| 354 | double Gguf::f(const std::string& key) const { |
| 355 | auto it = floats_.find(key); |
| 356 | if (it == floats_.end()) throw std::runtime_error("gguf: no float key " + key); |