Skip to content

Commit

Permalink
Bump sentence-transformers ONNX opset (#1634)
Browse files Browse the repository at this point in the history
bump sentence-transformers onnx opset
  • Loading branch information
fxmarty authored and echarlaix committed Jan 19, 2024
1 parent 7c2df73 commit 9335db2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion optimum/exporters/onnx/model_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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]]:
Expand Down

0 comments on commit 9335db2

Please sign in to comment.