examples/gguf : no need to keep q option for quantization any more

This commit is contained in:
M. Yusuf Sarıgöz 2023-08-17 08:56:42 +03:00
parent 5ec18934ad
commit 42f8fe1927

View File

@ -233,16 +233,13 @@ int main(int argc, char ** argv) {
const std::string fname(argv[1]); const std::string fname(argv[1]);
const std::string mode (argv[2]); const std::string mode (argv[2]);
GGML_ASSERT((mode == "r" || mode == "w" || mode == "q") && "mode must be r, w or q"); GGML_ASSERT((mode == "r" || mode == "w") && "mode must be r or w");
if (mode == "w") { if (mode == "w") {
GGML_ASSERT(gguf_ex_write(fname) && "failed to write gguf file"); GGML_ASSERT(gguf_ex_write(fname) && "failed to write gguf file");
} else if (mode == "r") { } else if (mode == "r") {
GGML_ASSERT(gguf_ex_read_0(fname) && "failed to read gguf file"); GGML_ASSERT(gguf_ex_read_0(fname) && "failed to read gguf file");
GGML_ASSERT(gguf_ex_read_1(fname) && "failed to read gguf file"); GGML_ASSERT(gguf_ex_read_1(fname) && "failed to read gguf file");
} else if (mode == "q") {
llama_model_quantize_params params = llama_model_quantize_default_params();
llama_model_quantize(fname.c_str(), "quant.gguf", &params);
} }
return 0; return 0;