From 74e0bad9f14a3eef9826a478432cabc144e7e844 Mon Sep 17 00:00:00 2001 From: Ella Charlaix Date: Fri, 6 Dec 2024 15:00:20 +0100 Subject: [PATCH 1/6] enable latest transformers release --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 6736085943a..28b6941ebe8 100644 --- a/setup.py +++ b/setup.py @@ -51,7 +51,7 @@ "datasets>=1.2.1", "evaluate", "protobuf>=3.20.1", - "transformers>=4.36,<4.47.0", + "transformers>=4.36,<4.48.0", ], "onnxruntime-gpu": [ "onnx", @@ -60,19 +60,19 @@ "evaluate", "protobuf>=3.20.1", "accelerate", # ORTTrainer requires it. - "transformers>=4.36,<4.47.0", + "transformers>=4.36,<4.48.0", ], "exporters": [ "onnx", "onnxruntime", "timm", - "transformers>=4.36,<4.47.0", + "transformers>=4.36,<4.48.0", ], "exporters-gpu": [ "onnx", "onnxruntime-gpu", "timm", - "transformers>=4.36,<4.47.0", + "transformers>=4.36,<4.48.0", ], "exporters-tf": [ "tensorflow>=2.4,<=2.12.1", From d8caf8c8e91f720bc103b1252664c01449da4f1e Mon Sep 17 00:00:00 2001 From: Ella Charlaix Date: Mon, 9 Dec 2024 17:54:17 +0100 Subject: [PATCH 2/6] fix custom module test --- tests/onnx/test_onnx_export_custom_module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/onnx/test_onnx_export_custom_module.py b/tests/onnx/test_onnx_export_custom_module.py index 4398c14f01d..9416093c841 100644 --- a/tests/onnx/test_onnx_export_custom_module.py +++ b/tests/onnx/test_onnx_export_custom_module.py @@ -22,7 +22,7 @@ if is_torch_available(): import torch - from transformers.models.deberta import modeling_deberta + from transformers.models.sew_d import modeling_sew_d from optimum.utils import check_if_torch_greater @@ -36,7 +36,7 @@ def test_training(self): """Tests export of StableDropout in training mode.""" devnull = open(os.devnull, "wb") # drop_prob must be > 0 for the test to be meaningful - sd = modeling_deberta.StableDropout(0.1) + sd = modeling_sew_d.StableDropout(0.1) # Avoid warnings in training mode do_constant_folding = False # Dropout is a no-op in inference mode From 0a9d89ce1f258925ab18b661e37bb9ba0ef0c2ea Mon Sep 17 00:00:00 2001 From: Ella Charlaix Date: Mon, 9 Dec 2024 18:32:12 +0100 Subject: [PATCH 3/6] adapt config push to hub tests --- tests/test_configuration_utils.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/tests/test_configuration_utils.py b/tests/test_configuration_utils.py index 4c721f089d7..d70b01fe7e1 100644 --- a/tests/test_configuration_utils.py +++ b/tests/test_configuration_utils.py @@ -12,13 +12,12 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import os import tempfile import unittest from huggingface_hub import HfFolder, delete_repo from requests.exceptions import HTTPError -from transformers.testing_utils import TOKEN, USER, is_staging_test +from transformers.testing_utils import TOKEN, TemporaryHubRepo, is_staging_test from optimum.configuration_utils import BaseConfig @@ -69,12 +68,11 @@ def tearDownClass(cls): def test_push_to_hub(self): config = FakeConfig(attribute=15) - with tempfile.TemporaryDirectory() as tmp_dir: - config.save_pretrained( - os.path.join(tmp_dir, "optimum-test-base-config"), push_to_hub=True, token=self._token - ) - new_config = FakeConfig.from_pretrained(f"{USER}/optimum-test-base-config") + with TemporaryHubRepo(token=self._token) as tmp_repo: + config.push_to_hub(tmp_repo.repo_id, token=self._token) + + new_config = FakeConfig.from_pretrained(tmp_repo.repo_id) for k, v in config.to_dict().items(): if k != "optimum_version" and k != "transformers_version": self.assertEqual(v, getattr(new_config, k)) @@ -82,15 +80,9 @@ def test_push_to_hub(self): def test_push_to_hub_in_organization(self): config = FakeConfig(attribute=15) - with tempfile.TemporaryDirectory() as tmp_dir: - config.save_pretrained( - os.path.join(tmp_dir, "optimum-test-base-config-org"), - push_to_hub=True, - token=self._token, - organization="valid_org", - ) - - new_config = FakeConfig.from_pretrained("valid_org/optimum-test-base-config-org") + with TemporaryHubRepo(namespace="valid_org", token=self._token) as tmp_repo: + config.push_to_hub(tmp_repo.repo_id, token=self._token) + new_config = FakeConfig.from_pretrained(tmp_repo.repo_id) for k, v in config.to_dict().items(): if k != "optimum_version" and k != "transformers_version": self.assertEqual(v, getattr(new_config, k)) From 552c5f71fb016196327608f617e833be487bc780 Mon Sep 17 00:00:00 2001 From: Ella Charlaix Date: Tue, 10 Dec 2024 15:14:09 +0100 Subject: [PATCH 4/6] downgrade macos runner --- .github/workflows/test_onnxruntime.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_onnxruntime.yml b/.github/workflows/test_onnxruntime.yml index b20a3b46f88..5c7a9a06096 100644 --- a/.github/workflows/test_onnxruntime.yml +++ b/.github/workflows/test_onnxruntime.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: transformers-version: ["latest"] - os: [ubuntu-20.04, windows-2019, macos-15] + os: [ubuntu-20.04, windows-2019, macos-14] include: - transformers-version: "4.36.*" os: ubuntu-20.04 From 8723dca71c4d9bab54bd68f934778f3e04da91c3 Mon Sep 17 00:00:00 2001 From: Ella Charlaix Date: Thu, 12 Dec 2024 11:50:26 +0100 Subject: [PATCH 5/6] downgrade --- .github/workflows/test_onnxruntime.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_onnxruntime.yml b/.github/workflows/test_onnxruntime.yml index 5c7a9a06096..be0edca08a2 100644 --- a/.github/workflows/test_onnxruntime.yml +++ b/.github/workflows/test_onnxruntime.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: transformers-version: ["latest"] - os: [ubuntu-20.04, windows-2019, macos-14] + os: [ubuntu-20.04, windows-2019, macos-13] include: - transformers-version: "4.36.*" os: ubuntu-20.04 From 63a1e5c2d3622b4d6b03a8e74f6fd8d90f7e15a8 Mon Sep 17 00:00:00 2001 From: Ella Charlaix Date: Thu, 12 Dec 2024 12:51:36 +0100 Subject: [PATCH 6/6] revert --- .github/workflows/test_onnxruntime.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_onnxruntime.yml b/.github/workflows/test_onnxruntime.yml index be0edca08a2..b20a3b46f88 100644 --- a/.github/workflows/test_onnxruntime.yml +++ b/.github/workflows/test_onnxruntime.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: transformers-version: ["latest"] - os: [ubuntu-20.04, windows-2019, macos-13] + os: [ubuntu-20.04, windows-2019, macos-15] include: - transformers-version: "4.36.*" os: ubuntu-20.04