File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
neural_compressor/onnxrt/algorithms/layer_wise Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 1919# limitations under the License.
2020
2121import os
22- import transformers
2322from copy import deepcopy
2423from pathlib import Path
2524from typing import Callable , List , Union
26- from packaging .version import Version
2725
2826import onnx
2927import onnxruntime as ort
28+ import transformers
29+ from packaging .version import Version
3030
3131from neural_compressor .common import Logger
3232from neural_compressor .onnxrt .quantization .calibrate import CalibrationDataReader
@@ -61,9 +61,10 @@ def layer_wise_quant(
6161 """
6262 # TODO: remove the limitation for lwq
6363 if Version (transformers .__version__ ) > Version ("4.37.2" ):
64- logger .warning ("Model (such as llama-2) exported with transformers {} may fail in layer-wise quant. "
65- "we recommend downgrading transformers to 4.37.2 and try again." .format (
66- transformers .__version__ ))
64+ logger .warning (
65+ "Model (such as llama-2) exported with transformers {} may fail in layer-wise quant. "
66+ "we recommend downgrading transformers to 4.37.2 and try again." .format (transformers .__version__ )
67+ )
6768
6869 # check whether model shape is inferred
6970 if not check_model_with_infer_shapes (model ):
You can’t perform that action at this time.
0 commit comments