Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
loop for dependencies' installation to avoid intermittent failures (#…
Browse files Browse the repository at this point in the history
…4865)

* loop for dependencies' installation to avoid intemitten failures

* fix typo

* fix seed to ensure reproducibility

* fix naming
  • Loading branch information
Golovneva authored Nov 7, 2022
1 parent 8b18a15 commit e1b4e36
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions tests/nightly/gpu/test_bert.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import unittest
import parlai.utils.testing as testing_utils
import torch


@testing_utils.skipUnlessGPU
Expand All @@ -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(
Expand Down

0 comments on commit e1b4e36

Please sign in to comment.