| 845 | } |
| 846 | |
| 847 | struct gguf_context * gguf_init_from_file(const char * fname, struct gguf_init_params params) { |
| 848 | FILE * file = ggml_fopen(fname, "rb"); |
| 849 | |
| 850 | if (!file) { |
| 851 | GGML_LOG_ERROR("%s: failed to open GGUF file '%s' (%s)\n", __func__, fname, strerror(errno)); |
| 852 | return nullptr; |
| 853 | } |
| 854 | |
| 855 | struct gguf_context * result = gguf_init_from_file_ptr(file, params); |
| 856 | fclose(file); |
| 857 | return result; |
| 858 | } |
| 859 | |
| 860 | void gguf_free(struct gguf_context * ctx) { |
| 861 | if (ctx == nullptr) { |
no test coverage detected