From 0e864fb29140a765ee20bbe7ea8afaec9df25d88 Mon Sep 17 00:00:00 2001 From: Tomasz Pietruszka Date: Tue, 22 Jan 2019 20:10:38 +0100 Subject: [PATCH] test_end_to_end now working, added instructions to README, sentencepiece dependency --- README.md | 10 ++++++++++ prepare_imdb.sh | 0 requirements.txt | 3 ++- tests/test_end_to_end.py | 3 ++- 4 files changed, 14 insertions(+), 2 deletions(-) mode change 100644 => 100755 prepare_imdb.sh diff --git a/README.md b/README.md index a04fca8..41cd8b6 100644 --- a/README.md +++ b/README.md @@ -88,3 +88,13 @@ $ git push --set-upstream n-waves ulmfit_multilingual # to automatically push u - `bilm` -- scripts to train biLM ELMo style, Bert style - `class` -- scripts to test classifiers on multiple languages - `xnli` -- scripts to test nli + + +## Running tests + +To run the tests, the following data is necessary: + +- wikitext-2 (prepared by `./prepare_wiki-en.sh`, along with wikitext-103) +- imdb (prepared by `./prepare_imdb.sh`) + +then simply run tests, e.g. `pytest .` diff --git a/prepare_imdb.sh b/prepare_imdb.sh old mode 100644 new mode 100755 diff --git a/requirements.txt b/requirements.txt index eb003e9..b211a96 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ fire>=0.1.3 cupy>=5.0.0 scikit-learn>=0.20 -sacremoses>=0.0.5 \ No newline at end of file +sacremoses>=0.0.5 +sentencepiece diff --git a/tests/test_end_to_end.py b/tests/test_end_to_end.py index 3d4d112..266bc3f 100644 --- a/tests/test_end_to_end.py +++ b/tests/test_end_to_end.py @@ -25,7 +25,8 @@ def get_test_data(): imdb = data / "imdb" test_data = data / "test" - shutil.rmtree(test_data) + if test_data.exists(): + shutil.rmtree(test_data) test_wt = test_data / 'wikitext-s' test_imdb = test_data / 'imdb'