diff --git a/optimum/exporters/onnx/model_configs.py b/optimum/exporters/onnx/model_configs.py index 78b80138563..fa39a47abfd 100644 --- a/optimum/exporters/onnx/model_configs.py +++ b/optimum/exporters/onnx/model_configs.py @@ -147,7 +147,7 @@ def inputs(self) -> Dict[str, Dict[int, str]]: class MPNetOnnxConfig(DistilBertOnnxConfig): - DEFAULT_ONNX_OPSET = 12 + DEFAULT_ONNX_OPSET = 12 # For lower opsets, results in: Type 'tensor(int64)' of input parameter (/0/auto_model/encoder/Add_1_output_0) of operator (Min) in node (/0/auto_model/encoder/Min) is invalid. class RobertaOnnxConfig(DistilBertOnnxConfig): @@ -817,6 +817,7 @@ def torch_to_onnx_input_map(self) -> Dict[str, str]: class SentenceTransformersTransformerOnnxConfig(TextEncoderOnnxConfig): NORMALIZED_CONFIG_CLASS = NormalizedTextConfig + DEFAULT_ONNX_OPSET = 14 # Some bottleneck transformers models require a specific ONNX opset to be successfully exported. We put a rather high opset here for the export to work for all architectures. @property def inputs(self) -> Dict[str, Dict[int, str]]: