From 02eb17655d8d76d078bf61af438f4baa5e62b375 Mon Sep 17 00:00:00 2001 From: Ye Wang <52801275+wangyems@users.noreply.github.com> Date: Wed, 20 Dec 2023 06:53:33 +0000 Subject: [PATCH] Fix a bug in 4bits quantizer script (#18878) ### Description ### Motivation and Context --- .../python/tools/quantization/matmul_4bits_quantizer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/onnxruntime/python/tools/quantization/matmul_4bits_quantizer.py b/onnxruntime/python/tools/quantization/matmul_4bits_quantizer.py index 1c3c212b54..9f90196e30 100644 --- a/onnxruntime/python/tools/quantization/matmul_4bits_quantizer.py +++ b/onnxruntime/python/tools/quantization/matmul_4bits_quantizer.py @@ -193,9 +193,13 @@ set of 4b integers with a scaling factor and an optional offset. parser.add_argument("--input_model", required=True, help="Path to the input model file") parser.add_argument("--output_model", required=True, help="Path to the output model file") - parser.add_argument("--block_size", required=False, default=32) + parser.add_argument("--block_size", required=False, default=32, type=int, help="Block size for quantization") parser.add_argument( - "--symmetric", required=False, default=True, help="Indicate whether to quantize the model symmetrically" + "--symmetric", + required=False, + default=True, + type=bool, + help="Indicate whether to quantize the model symmetrically", ) parser.add_argument("-v", "--verbose", required=False, action="store_true") parser.set_defaults(verbose=False)