Skip to content

Commit 4f1ee70

Browse files
compiladeNexesenex
authored andcommitted
imatrix : warn when GGUF imatrix is saved without .gguf suffix (ggml-org#15076)
* imatrix : add warning when suffix is not .gguf for GGUF imatrix * imatrix : only warn about suffix when output format is unspecified
1 parent 8c70887 commit 4f1ee70

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

common/arg.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,10 +2648,10 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
26482648
).set_examples({LLAMA_EXAMPLE_IMATRIX}));
26492649
add_opt(common_arg(
26502650
{"--output-format"}, "{gguf,dat}",
2651-
string_format("output format for imatrix file (default: %s)", params.imat_dat ? "dat" : "gguf"),
2651+
string_format("output format for imatrix file (default: %s)", params.imat_dat > 0 ? "dat" : "gguf"),
26522652
[](common_params & params, const std::string & value) {
2653-
/**/ if (value == "gguf") { params.imat_dat = false; }
2654-
else if (value == "dat") { params.imat_dat = true; }
2653+
/**/ if (value == "gguf") { params.imat_dat = -1; }
2654+
else if (value == "dat") { params.imat_dat = 1; }
26552655
else { throw std::invalid_argument("invalid output format"); }
26562656
}
26572657
).set_examples({LLAMA_EXAMPLE_IMATRIX}));

common/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +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
437+
int8_t imat_dat = 0; // whether the legacy imatrix.dat format should be output (gguf <= 0 < dat)
438438

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

0 commit comments

Comments
 (0)