Skip to content

Commit

Permalink
[TTS] Change manifest paths argument to list
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan <[email protected]>
  • Loading branch information
rlangman committed May 5, 2023
1 parent e15424a commit e164d6f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scripts/dataset_processing/tts/create_speaker_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
names in your manifest with the name of the dataset.
$ python <nemo_root_path>/scripts/dataset_processing/tts/create_speaker_map.py \
--manifest_paths=manifest1.json,manifest2.json \
--manifest_path=manifest1.json \
--manifest_path=manifest2.json \
--speaker_map_path=speakers.json
Example output:
Expand All @@ -47,7 +48,7 @@ def get_args():
description="Create mapping from speaker names to numerical speaker indices.",
)
parser.add_argument(
"--manifest_paths", required=True, type=str, help="Path to training manifests, comma delimited",
"--manifest_path", required=True, type=Path, action="append", help="Path to training manifest(s).",
)
parser.add_argument(
"--speaker_map_path", required=True, type=Path, help="Path for output speaker index JSON",
Expand All @@ -61,12 +62,10 @@ def get_args():

def main():
args = get_args()
manifest_path_string = args.manifest_paths
manifest_paths = args.manifest_path
speaker_map_path = args.speaker_map_path
overwrite = args.overwrite

manifest_paths = [Path(manifest_path) for manifest_path in manifest_path_string.split(",")]

for manifest_path in manifest_paths:
if not manifest_path.exists():
raise ValueError(f"Manifest {manifest_path} does not exist.")
Expand Down

0 comments on commit e164d6f

Please sign in to comment.