From fc214d44fc35043daeb310f2c48c05995ea419cc Mon Sep 17 00:00:00 2001 From: fxmarty <9808326+fxmarty@users.noreply.github.com> Date: Tue, 9 Jan 2024 12:00:44 +0100 Subject: [PATCH] Bump sentence-transformers ONNX opset (#1634) bump sentence-transformers onnx opset --- optimum/exporters/onnx/model_configs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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]]: