MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / gguf_write_to_file

Function gguf_write_to_file

external/ggml/src/gguf.cpp:1528–1543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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());
1530 return false;
1531 }
1532 return true;
1533}
1534
1535bool gguf_write_to_file(const struct gguf_context * ctx, const char * fname, bool only_meta) {
1536 FILE * file = ggml_fopen(fname, "wb");
1537
1538 if (!file) {
1539 GGML_LOG_ERROR("%s: failed to open file '%s' for writing GGUF data\n", __func__, fname);
1540 return false;
1541 }
1542
1543 const bool success = gguf_write_to_file_ptr(ctx, file, only_meta);
1544 if (!success) {
1545 GGML_LOG_ERROR("%s: failed to write GGUF data into '%s'\n", __func__, fname);
1546 }

Callers 1

mnist_model_saveFunction · 0.85

Calls 2

ggml_fopenFunction · 0.85
gguf_write_to_file_ptrFunction · 0.85

Tested by

no test coverage detected