Skip to content

Commit

Permalink
Add metafile arg (#1977)
Browse files Browse the repository at this point in the history
  • Loading branch information
erogol authored Sep 16, 2022
1 parent dba2c35 commit 0a112f7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions TTS/bin/compute_embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Example runs:
python TTS/bin/compute_embeddings.py --model_path speaker_encoder_model.pth --config_path speaker_encoder_config.json --config_dataset_path dataset_config.json
python TTS/bin/compute_embeddings.py --model_path speaker_encoder_model.pth --config_path speaker_encoder_config.json --fomatter vctk --dataset_path /path/to/vctk/dataset --dataset_name my_vctk
python TTS/bin/compute_embeddings.py --model_path speaker_encoder_model.pth --config_path speaker_encoder_config.json --fomatter vctk --dataset_path /path/to/vctk/dataset --dataset_name my_vctk --metafile /path/to/vctk/metafile.csv
""",
formatter_class=RawTextHelpFormatter,
)
Expand Down Expand Up @@ -46,22 +46,27 @@
parser.add_argument(
"--formatter_name",
type=str,
help="Name of the formatter to use. You either need to provicder this or `config_dataset_path`",
help="Name of the formatter to use. You either need to provide this or `config_dataset_path`",
default=None,
)
parser.add_argument(
"--dataset_name",
type=str,
help="Name of the dataset to use. You either need to provicder this or `config_dataset_path`",
help="Name of the dataset to use. You either need to provide this or `config_dataset_path`",
default=None,
)
parser.add_argument(
"--dataset_path",
type=str,
help="Path to the dataset. You either need to provicder this or `config_dataset_path`",
help="Path to the dataset. You either need to provide this or `config_dataset_path`",
default=None,
)
parser.add_argument(
"--metafile",
type=str,
help="Path to the meta file. If not set, dataset formatter uses the default metafile if it is defined in the formatter. You either need to provide this or `config_dataset_path`",
default=None,
)

args = parser.parse_args()

use_cuda = torch.cuda.is_available() and not args.disable_cuda
Expand All @@ -74,6 +79,7 @@
c_dataset.formatter = args.formatter_name
c_dataset.dataset_name = args.dataset_name
c_dataset.path = args.dataset_path
c_dataset.meta_file_train = args.metafile if args.metafile else None
meta_data_train, meta_data_eval = load_tts_samples(c_dataset, eval_split=not args.no_eval)


Expand Down

0 comments on commit 0a112f7

Please sign in to comment.