| 2114 | } |
| 2115 | |
| 2116 | size_t file_offset(const char * name) const { |
| 2117 | const int idx = gguf_find_tensor(ctx_gguf, name); |
| 2118 | |
| 2119 | if (idx < 0) { |
| 2120 | throw std::runtime_error(format("%s: tensor '%s' not found in the file", __func__, name)); |
| 2121 | } |
| 2122 | |
| 2123 | return gguf_get_data_offset(ctx_gguf) + gguf_get_tensor_offset(ctx_gguf, idx); |
| 2124 | } |
| 2125 | |
| 2126 | void load_data_for(struct ggml_tensor * cur) const { |
| 2127 | const size_t offs = file_offset(ggml_get_name(cur)); |
nothing calls this directly
no test coverage detected