File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
tensorflow_datasets/scripts/cli Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 27
27
with epy .lazy_imports ():
28
28
# pylint: disable=g-import-not-at-top
29
29
import concurrent .futures
30
+ import tqdm
30
31
31
32
from absl import logging
32
33
import apache_beam as beam
@@ -59,9 +60,10 @@ class ShardInstruction:
59
60
convert_fn : ConvertFn | None = None
60
61
61
62
def convert (self ) -> None :
63
+ """Converts the shard to the desired file format."""
62
64
def read_in () -> Iterator [type_utils .KeySerializedExample ]:
63
65
in_dataset = self .in_file_adapter .make_tf_data (filename = self .in_path )
64
- for i , row in enumerate (in_dataset ):
66
+ for i , row in tqdm . tqdm ( enumerate (in_dataset ) ):
65
67
if self .convert_fn is not None :
66
68
yield i , self .convert_fn (row )
67
69
else :
@@ -364,7 +366,7 @@ def _convert_dataset_dirs(
364
366
)
365
367
366
368
logging .info ('All shards have been converted. Now converting metadata.' )
367
- for dataset_dir , info in found_dataset_versions .items ():
369
+ for dataset_dir , info in tqdm . tqdm ( found_dataset_versions .items () ):
368
370
out_dir = from_to_dirs [dataset_dir ]
369
371
logging .info ('Converting metadata in %s.' , dataset_dir )
370
372
convert_metadata (
You can’t perform that action at this time.
0 commit comments