From 9d1ef009b877e7f67b9844a959c43fdf99891439 Mon Sep 17 00:00:00 2001 From: Zachary Mueller Date: Fri, 18 Nov 2022 11:33:25 -0500 Subject: [PATCH] Fix flakey test with seed (#20318) --- examples/pytorch/test_accelerate_examples.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/pytorch/test_accelerate_examples.py b/examples/pytorch/test_accelerate_examples.py index 17c7ccdd73..306cd9a34f 100644 --- a/examples/pytorch/test_accelerate_examples.py +++ b/examples/pytorch/test_accelerate_examples.py @@ -26,7 +26,7 @@ from unittest import mock import torch from accelerate.utils import write_basic_config -from transformers.testing_utils import TestCasePlus, get_gpu_count, is_flaky, run_command, slow, torch_device +from transformers.testing_utils import TestCasePlus, get_gpu_count, run_command, slow, torch_device from transformers.utils import is_apex_available @@ -176,7 +176,6 @@ class ExamplesTestsNoTrainer(TestCasePlus): self.assertTrue(os.path.exists(os.path.join(tmp_dir, "epoch_0"))) self.assertTrue(os.path.exists(os.path.join(tmp_dir, "ner_no_trainer"))) - @is_flaky() @mock.patch.dict(os.environ, {"WANDB_MODE": "offline"}) def test_run_squad_no_trainer(self): tmp_dir = self.get_auto_remove_tmp_dir() @@ -187,6 +186,7 @@ class ExamplesTestsNoTrainer(TestCasePlus): --train_file tests/fixtures/tests_samples/SQUAD/sample.json --validation_file tests/fixtures/tests_samples/SQUAD/sample.json --output_dir {tmp_dir} + --seed=42 --max_train_steps=10 --num_warmup_steps=2 --learning_rate=2e-4