Closed pravarmahajan closed 6 years ago
The test assertion checks if the first row of the Test Dataset of IMDB matches the given text and sentiment.
The assertion fails, as the order of rows returned is not fixed. This is due to glob.iglob, which returns files in arbitrary order.
python -m pytest tests/datasets/test_imdb.py
or...
>>> from torchnlp.datasets import imdb >>> train, test = imdb.imdb_dataset(train=True, test=True) >>> print(test[0]['text'])
Hi!
Update IMDB and IWSLT tests to be deterministic via this PR: https://github.com/PetrochukM/PyTorch-NLP/pull/46
Thanks!
Expected Behavior
The test assertion checks if the first row of the Test Dataset of IMDB matches the given text and sentiment.
Actual Behavior
The assertion fails, as the order of rows returned is not fixed. This is due to glob.iglob, which returns files in arbitrary order.
Steps to Reproduce the Problem
or...