From 914de679ca7373f70545371ba397810baef37725 Mon Sep 17 00:00:00 2001 From: "Wang, Mengni" Date: Tue, 18 Apr 2023 10:35:30 +0800 Subject: [PATCH] Update main.py --- .../text_classification/quantization/ptq_static/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/onnxrt/nlp/huggingface_model/text_classification/quantization/ptq_static/main.py b/examples/onnxrt/nlp/huggingface_model/text_classification/quantization/ptq_static/main.py index 4c792f8d6c6..fda56696bf1 100644 --- a/examples/onnxrt/nlp/huggingface_model/text_classification/quantization/ptq_static/main.py +++ b/examples/onnxrt/nlp/huggingface_model/text_classification/quantization/ptq_static/main.py @@ -416,6 +416,8 @@ def eval_func(model, *args): # fp32_op_names = ['Gemm_1410_MatMul', 'MatMul_(259|168)'] config = PostTrainingQuantConfig(approach='static', quant_format=args.quant_format, + recipes={'smooth_quant': True, + 'smooth_quant_args': {'alpha': 0.5}}, op_name_dict={op_name:FP32 for op_name in fp32_op_names} \ if fp32_op_names else None,) q_model = quantization.fit(model,