From 8622d3bb8b3090c428d39c8dd014c0e70d3562af Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 30 Jan 2024 22:01:12 +0000 Subject: [PATCH] Pin Torch to <2.2.0 (#28785) * Pin torch to <2.2.0 * Pin torchvision and torchaudio as well * Playing around with versions to see if this helps * twiddle something to restart the CI * twiddle it back * Try changing the natten version * make fixup * Revert "Try changing the natten version" This reverts commit de0d6592c35dc39ae8b5a616c27285db28262d06. * make fixup * fix fix fix * fix fix fix --------- Co-authored-by: ydshieh --- .circleci/create_circleci_config.py | 1 + examples/pytorch/_tests_requirements.txt | 4 +++- setup.py | 6 +++--- src/transformers/dependency_versions_table.py | 6 +++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.circleci/create_circleci_config.py b/.circleci/create_circleci_config.py index 1b020e0a9fe20b..87b6a1342c5887 100644 --- a/.circleci/create_circleci_config.py +++ b/.circleci/create_circleci_config.py @@ -474,6 +474,7 @@ def job_name(self): "pip install -U --upgrade-strategy eager python-Levenshtein", "pip install -U --upgrade-strategy eager opencv-python", "pip install -U --upgrade-strategy eager nltk", + "pip uninstall -y torch torchvision torchaudio && pip install -U --upgrade-strategy eager 'torch<2.2.0' 'torchvision<0.17' 'torchaudio<2.2.0'" ], tests_to_run=[ "tests/models/*layoutlmv*", diff --git a/examples/pytorch/_tests_requirements.txt b/examples/pytorch/_tests_requirements.txt index 979890f4b79c38..4b436023146ab7 100644 --- a/examples/pytorch/_tests_requirements.txt +++ b/examples/pytorch/_tests_requirements.txt @@ -19,7 +19,9 @@ pytest conllu sentencepiece != 0.1.92 protobuf -torchvision +torch<2.2.0 +torchvision<0.17 +torchaudio<2.2.0 jiwer librosa evaluate >= 0.2.0 diff --git a/setup.py b/setup.py index 25d8eb28c22e07..c4a38eccea2f3c 100644 --- a/setup.py +++ b/setup.py @@ -175,9 +175,9 @@ "timeout-decorator", "timm", "tokenizers>=0.14,<0.19", - "torch>=1.11,!=1.12.0", - "torchaudio", - "torchvision", + "torch<2.2.0", + "torchaudio<2.2.0", + "torchvision<0.17.0", "pyctcdecode>=0.4.0", "tqdm>=4.27", "unidic>=1.0.2", diff --git a/src/transformers/dependency_versions_table.py b/src/transformers/dependency_versions_table.py index 03ec63a2795928..4df2ff8c72957b 100644 --- a/src/transformers/dependency_versions_table.py +++ b/src/transformers/dependency_versions_table.py @@ -80,9 +80,9 @@ "timeout-decorator": "timeout-decorator", "timm": "timm", "tokenizers": "tokenizers>=0.14,<0.19", - "torch": "torch>=1.11,!=1.12.0", - "torchaudio": "torchaudio", - "torchvision": "torchvision", + "torch": "torch<2.2.0", + "torchaudio": "torchaudio<2.2.0", + "torchvision": "torchvision<0.17.0", "pyctcdecode": "pyctcdecode>=0.4.0", "tqdm": "tqdm>=4.27", "unidic": "unidic>=1.0.2",