| 1513 | gw.write_tensor_data(ctx->info[i], offset_data, ctx->alignment); |
| 1514 | } |
| 1515 | } |
| 1516 | |
| 1517 | void gguf_write_to_buf(const struct gguf_context * ctx, std::vector<int8_t> & buf, bool only_meta) { |
| 1518 | gguf_writer_buf gw(buf); |
| 1519 | gguf_write_out(ctx, gw, only_meta); |
| 1520 | } |
| 1521 | |
| 1522 | bool gguf_write_to_file_ptr(const struct gguf_context * ctx, FILE * file, bool only_meta) { |
| 1523 | GGML_ASSERT(file); |
| 1524 | |
| 1525 | try { |
| 1526 | gguf_writer_file gw(file); |
| 1527 | gguf_write_out(ctx, gw, only_meta); |
| 1528 | } catch (const std::runtime_error& ex) { |
| 1529 | GGML_LOG_ERROR("%s: failed to write GGUF data: %s\n", __func__, ex.what()); |
no test coverage detected