Skip to content

Commit 6b3f2d6

Browse files
committed
Check number of speakers in dataset matches FS2 params
1 parent 9d076a0 commit 6b3f2d6

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

examples/fastspeech2_libritts/fastspeech2_dataset.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,6 @@ def __init__(
118118
self.energy_load_fn = energy_load_fn
119119
self.mel_length_threshold = mel_length_threshold
120120
self.speakers_map = speakers_map
121-
# sp_id = 0
122-
# for i in self.utt_ids:
123-
# sp_name = i.split("_")[0]
124-
# if sp_name not in self.speakers_map:
125-
# self.speakers_map[sp_name] = sp_id
126-
# sp_id += 1
127121
self.speakers = [
128122
self.speakers_map[i.split("_")[0]] for i in self.utt_ids
129123
] # TODO change but at the moment mfa folder name = speaker name

examples/fastspeech2_libritts/train_fastspeech2.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,10 @@ def main():
359359
with open(args.dataset_mapping) as f:
360360
dataset_mapping = json.load(f)
361361
speakers_map = dataset_mapping["speakers_map"]
362-
print("SPEAKERS MAP TYPE IS: " , type(speakers_map))
363-
print(speakers_map)
362+
363+
# Check n_speakers matches number of speakers in speakers_map
364+
n_speakers = config["fastspeech2_params"]["n_speakers"]
365+
assert n_speakers == len(speakers_map)
364366

365367
# define train/valid dataset
366368
train_dataset = CharactorDurationF0EnergyMelDataset(

0 commit comments

Comments
 (0)