import argparse from onnxruntime.quantization import quantize_dynamic, QuantType def main(): parser = argparse.ArgumentParser(description="Quantize an ONNX model to int8") parser.add_argument("--model_path", type=str, required=True, help="Path to the model to be quantized") parser.add_argument("--output_path", type=str, required=True, help="Path to save the quantized model") args = parser.parse_args() quantize_dynamic(args.model_path, args.output_path, weight_type=QuantType.QInt8) if __name__ == "__main__": main()