diff options
author | Stephan Walter <stephan@walter.name> | 2023-04-11 15:03:51 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-11 15:03:51 +0000 |
commit | 3e6e70d8e8917b5bd14c7c9f9b89a585f1ff0b31 (patch) | |
tree | 35dc380c6585d36941e155b9aae949e757af2b02 /examples/quantize | |
parent | 2663d2c6784ad7b77998c6874df25648d597f74b (diff) |
Add enum llama_ftype, sync ggml_type to model files (#709)
Diffstat (limited to 'examples/quantize')
-rw-r--r-- | examples/quantize/quantize.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/quantize/quantize.cpp b/examples/quantize/quantize.cpp index 680757c..5c9e2ad 100644 --- a/examples/quantize/quantize.cpp +++ b/examples/quantize/quantize.cpp @@ -5,15 +5,15 @@ #include <string> // usage: -// ./llama-quantize models/llama/ggml-model.bin models/llama/ggml-model-quant.bin type +// ./quantize models/llama/ggml-model.bin models/llama/ggml-model-quant.bin type // int main(int argc, char ** argv) { ggml_time_init(); if (argc != 4) { fprintf(stderr, "usage: %s model-f32.bin model-quant.bin type\n", argv[0]); - fprintf(stderr, " type = 2 - q4_0\n"); - fprintf(stderr, " type = 3 - q4_1\n"); + fprintf(stderr, " type = %d - q4_0\n", LLAMA_FTYPE_MOSTLY_Q4_0); + fprintf(stderr, " type = %d - q4_1\n", LLAMA_FTYPE_MOSTLY_Q4_1); return 1; } @@ -27,7 +27,7 @@ int main(int argc, char ** argv) { const std::string fname_inp = argv[1]; const std::string fname_out = argv[2]; - const int itype = atoi(argv[3]); + const enum llama_ftype ftype = (enum llama_ftype)atoi(argv[3]); const int64_t t_main_start_us = ggml_time_us(); @@ -37,7 +37,7 @@ int main(int argc, char ** argv) { { const int64_t t_start_us = ggml_time_us(); - if (llama_model_quantize(fname_inp.c_str(), fname_out.c_str(), itype)) { + if (llama_model_quantize(fname_inp.c_str(), fname_out.c_str(), ftype)) { fprintf(stderr, "%s: failed to quantize model from '%s'\n", __func__, fname_inp.c_str()); return 1; } |