| 47 | } |
| 48 | |
| 49 | static struct gguf_context * load_gguf(std::string & fname, struct ggml_context ** ctx_ggml) { |
| 50 | struct gguf_init_params params = { |
| 51 | /*.no_alloc = */ true, |
| 52 | /*.ctx = */ ctx_ggml, |
| 53 | }; |
| 54 | struct gguf_context * ctx_gguf = gguf_init_from_file(fname.c_str(), params); |
| 55 | if (!ctx_gguf) { |
| 56 | throw std::runtime_error("failed to load input GGUF from " + fname); |
| 57 | } |
| 58 | return ctx_gguf; |
| 59 | } |
| 60 | |
| 61 | struct file_input { |
| 62 | struct ggml_context * ctx_meta = nullptr; |
no test coverage detected