Skip to content

Commit

Permalink
Add parameters for root data dir and dataset dir to convert format
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 615356506
  • Loading branch information
tomvdw authored and The TensorFlow Datasets Authors committed Mar 13, 2024
1 parent 36b6a04 commit 303814e
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion tensorflow_datasets/scripts/convert_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,27 @@
from tensorflow_datasets.scripts.cli import convert_format_utils


_ROOT_DATA_DIR = flags.DEFINE_string(
'root_data_dir',
required=False,
help=(
'Root data dir that contains all datasets. All datasets and all their'
' configs and versions that are in this folder will be converted.'
),
default=None,
)
_DATASET_DIR = flags.DEFINE_string(
'dataset_dir',
required=True,
required=False,
help=(
'Path where the dataset to be converted is located. Converts all'
' configs and versions in this folder.'
),
default=None,
)
_DATASET_VERSION_DIR = flags.DEFINE_string(
'dataset_version_dir',
required=False,
help=(
'Path where the dataset to be converted is located. Should include'
' config and version.'
Expand Down Expand Up @@ -81,7 +99,9 @@

def main(_):
convert_format_utils.convert_dataset(
root_data_dir=_ROOT_DATA_DIR.value,
dataset_dir=_DATASET_DIR.value,
dataset_version_dir=_DATASET_VERSION_DIR.value,
out_file_format=_OUT_FILE_FORMAT.value,
out_dir=_OUT_DIR.value,
use_beam=_USE_BEAM.value,
Expand Down

0 comments on commit 303814e

Please sign in to comment.