Add support for IterableDatasets everywhere (#1104)

* Add support for IterableDatasets everywhere

* Added type hints, simplified code and improved coverage in data_loading.py

* Update CHANGELOG.md
This commit is contained in:
Ethan Harris
2020-03-12 12:46:02 -04:00
committed by GitHub
parent 1383f64a5f
commit 2b3f443f6b
7 changed files with 327 additions and 147 deletions
+3 -3
View File
@@ -358,9 +358,9 @@ class TrainerEvaluationLoopMixin(ABC):
# main progress bar will already be closed when testing so initial position is free
position = 2 * self.process_position + (not test_mode)
desc = 'Testing' if test_mode else 'Validating'
pbar = tqdm(desc=desc, total=max_batches, leave=test_mode, position=position,
disable=not self.show_progress_bar, dynamic_ncols=True,
file=sys.stdout)
total = max_batches if max_batches != float('inf') else None
pbar = tqdm(desc=desc, total=total, leave=test_mode, position=position,
disable=not self.show_progress_bar, dynamic_ncols=True, file=sys.stdout)
setattr(self, f'{"test" if test_mode else "val"}_progress_bar', pbar)
# run evaluation