| 1513 | } |
| 1514 | |
| 1515 | bool gguf_write_to_file_ptr(const struct gguf_context * ctx, FILE * file, bool only_meta) { |
| 1516 | GGML_ASSERT(file); |
| 1517 | |
| 1518 | try { |
| 1519 | gguf_writer_file gw(file); |
| 1520 | gguf_write_out(ctx, gw, only_meta); |
| 1521 | } catch (const std::runtime_error& ex) { |
| 1522 | GGML_LOG_ERROR("%s: failed to write GGUF data: %s\n", __func__, ex.what()); |
| 1523 | return false; |
| 1524 | } |
| 1525 | return true; |
| 1526 | } |
| 1527 | |
| 1528 | bool gguf_write_to_file(const struct gguf_context * ctx, const char * fname, bool only_meta) { |
| 1529 | FILE * file = ggml_fopen(fname, "wb"); |