Skip to content

Commit c9f6675

Browse files
compiladeNexesenex
authored andcommitted
imatrix : use GGUF by default (ggml-org#14842)
* imatrix : use GGUF by default * imatrix : use GGUF regardless of the output filename The legacy format can only be produced with --output-format dat
1 parent c0c8da1 commit c9f6675

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

common/arg.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2646,6 +2646,15 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
26462646
params.n_out_freq = value;
26472647
}
26482648
).set_examples({LLAMA_EXAMPLE_IMATRIX}));
2649+
add_opt(common_arg(
2650+
{"--output-format"}, "{gguf,dat}",
2651+
string_format("output format for imatrix file (default: %s)", params.imat_dat ? "dat" : "gguf"),
2652+
[](common_params & params, const std::string & value) {
2653+
/**/ if (value == "gguf") { params.imat_dat = false; }
2654+
else if (value == "dat") { params.imat_dat = true; }
2655+
else { throw std::invalid_argument("invalid output format"); }
2656+
}
2657+
).set_examples({LLAMA_EXAMPLE_IMATRIX}));
26492658
add_opt(common_arg(
26502659
{"--save-frequency"}, "N",
26512660
string_format("save an imatrix copy every N iterations (default: %d)", params.n_save_freq),

common/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ struct common_params {
434434
int32_t n_out_freq = 10; // output the imatrix every n_out_freq iterations
435435
int32_t n_save_freq = 0; // save the imatrix every n_save_freq iterations
436436
int32_t i_chunk = 0; // start processing from this chunk
437+
bool imat_dat = false; // whether the legacy imatrix.dat format should be output
437438

438439
bool process_output = false; // collect data for the output tensor
439440
bool compute_ppl = true; // whether to compute perplexity

0 commit comments

Comments
 (0)