|
19 | 19 | from logging import getLogger
|
20 | 20 | from typing import Tuple, Dict, Union, Optional, Iterable, Any, Collection
|
21 | 21 |
|
| 22 | +from tqdm import tqdm |
| 23 | + |
22 | 24 | from deeppavlov.core.commands.infer import build_model
|
23 | 25 | from deeppavlov.core.common.chainer import Chainer
|
24 | 26 | from deeppavlov.core.common.params import from_params
|
@@ -90,7 +92,7 @@ def fit_chainer(self, iterator: Union[DataFittingIterator, DataLearningIterator]
|
90 | 92 | targets = [targets]
|
91 | 93 |
|
92 | 94 | if self.batch_size > 0 and callable(getattr(component, 'partial_fit', None)):
|
93 |
| - for i, (x, y) in enumerate(iterator.gen_batches(self.batch_size, shuffle=False)): |
| 95 | + for i, (x, y) in tqdm(enumerate(iterator.gen_batches(self.batch_size, shuffle=False))): |
94 | 96 | preprocessed = self._chainer.compute(x, y, targets=targets)
|
95 | 97 | # noinspection PyUnresolvedReferences
|
96 | 98 | component.partial_fit(*preprocessed)
|
@@ -160,7 +162,7 @@ def test(self, data: Iterable[Tuple[Collection[Any], Collection[Any]]],
|
160 | 162 |
|
161 | 163 | data = islice(data, self.max_test_batches)
|
162 | 164 |
|
163 |
| - for x, y_true in data: |
| 165 | + for x, y_true in tqdm(data): |
164 | 166 | examples += len(x)
|
165 | 167 | y_predicted = list(self._chainer.compute(list(x), list(y_true), targets=expected_outputs))
|
166 | 168 | if len(expected_outputs) == 1:
|
|
0 commit comments