diff --git a/.circleci/config.yml b/.circleci/config.yml index 71d67414a9c..c6f5f8f34b1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -91,17 +91,17 @@ commands: - run: name: Installs basic dependencies command: | - python -m pip install --progress-bar off pip setuptools==62.3.4 - python -m pip install --progress-bar off coverage - python -m pip install --progress-bar off codecov + for i in $(seq 1 3); do python -m pip install --progress-bar off pip setuptools==62.3.4 && s=0 && break || s=$? && sleep 10; done; (exit $s) + for i in $(seq 1 3); do python -m pip install --progress-bar off coverage && s=0 && break || s=$? && sleep 10; done; (exit $s) + for i in $(seq 1 3); do python -m pip install --progress-bar off codecov && s=0 && break || s=$? && sleep 10; done; (exit $s) mkdir -p ~/ParlAI/test-results - pip install -v -r requirements.txt - python setup.py develop - python -c "import nltk; nltk.download('punkt')" - python -c "import nltk; nltk.download('stopwords')" - python -c "import nltk; nltk.download('omw-1.4')" - python -m pip install --progress-bar off spacy - python -m spacy download en_core_web_sm + for i in $(seq 1 3); do pip install -v -r requirements.txt && s=0 && break || s=$? && sleep 10; done; (exit $s) + for i in $(seq 1 3); do python setup.py develop && s=0 && break || s=$? && sleep 10; done; (exit $s) + for i in $(seq 1 3); do python -c "import nltk; nltk.download('punkt')" && s=0 && break || s=$? && sleep 10; done; (exit $s) + for i in $(seq 1 3); do python -c "import nltk; nltk.download('stopwords')" && s=0 && break || s=$? && sleep 10; done; (exit $s) + for i in $(seq 1 3); do python -c "import nltk; nltk.download('omw-1.4')" && s=0 && break || s=$? && sleep 10; done; (exit $s) + for i in $(seq 1 3); do python -m pip install --progress-bar off spacy && s=0 && break || s=$? && sleep 10; done; (exit $s) + for i in $(seq 1 3); do python -m spacy download en_core_web_sm && s=0 && break || s=$? && sleep 10; done; (exit $s) installtorchgpu: description: Install torch GPU and dependencies diff --git a/tests/nightly/gpu/test_bert.py b/tests/nightly/gpu/test_bert.py index b506644214d..04b8cf1fca5 100644 --- a/tests/nightly/gpu/test_bert.py +++ b/tests/nightly/gpu/test_bert.py @@ -6,6 +6,7 @@ import unittest import parlai.utils.testing as testing_utils +import torch @testing_utils.skipUnlessGPU @@ -17,6 +18,11 @@ class TestBertModel(unittest.TestCase): samples on convai2 """ + def setUp(self) -> None: + super().setUp() + # set seeds for reproducibility + torch.manual_seed(seed=42) + def test_biencoder(self): valid, test = testing_utils.train_model( dict(