Skip to content

Commit

Permalink
fix min transformers version
Browse files Browse the repository at this point in the history
  • Loading branch information
echarlaix committed Jul 25, 2024
1 parent bc5d442 commit ee4aee5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test_export_onnx_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
matrix:
python-version: [3.8, 3.9]
os: [ubuntu-20.04]
transformers-version: ["4.33.0", "4.42.*"]

runs-on: ${{ matrix.os }}
steps:
Expand All @@ -28,7 +27,6 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for pytorch export
run: |
pip install transformers==${{ matrix.transformers-version }}
pip install .[tests,exporters]
- name: Test with unittest
working-directory: tests
Expand Down
6 changes: 4 additions & 2 deletions optimum/exporters/onnx/model_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class LlamaOnnxConfig(TextDecoderWithPositionIdsOnnxConfig):


class Qwen2OnnxConfig(LlamaOnnxConfig):
pass
MIN_TRANSFORMERS_VERSION = version.parse("4.37.0")


class GemmaOnnxConfig(LlamaOnnxConfig):
Expand All @@ -291,6 +291,7 @@ class GemmaOnnxConfig(LlamaOnnxConfig):
class PhiOnnxConfig(TextDecoderWithPositionIdsOnnxConfig):
DEFAULT_ONNX_OPSET = 14 # Phi now uses F.scaled_dot_product_attention by default for torch>=2.1.1.
NORMALIZED_CONFIG_CLASS = NormalizedTextConfig
MIN_TRANSFORMERS_VERSION = version.parse("4.36.0")


class Phi3OnnxConfig(PhiOnnxConfig):
Expand All @@ -299,6 +300,7 @@ class Phi3OnnxConfig(PhiOnnxConfig):
) + TextDecoderOnnxConfig.DUMMY_INPUT_GENERATOR_CLASSES
DUMMY_PKV_GENERATOR_CLASS = MistralDummyPastKeyValuesGenerator
NORMALIZED_CONFIG_CLASS = NormalizedTextConfigWithGQA
MIN_TRANSFORMERS_VERSION = version.parse("4.41.0")


class MistralOnnxConfig(TextDecoderWithPositionIdsOnnxConfig):
Expand Down Expand Up @@ -1173,7 +1175,7 @@ def outputs(self) -> Dict[str, Dict[int, str]]:


class OwlV2OnnxConfig(OwlViTOnnxConfig):
pass
MIN_TRANSFORMERS_VERSION = version.parse("4.35.0")


class LayoutLMOnnxConfig(TextAndVisionOnnxConfig):
Expand Down

0 comments on commit ee4aee5

Please sign in to comment.