Update train_vits-2.py
Browse files- train_vits-2.py +0 -35
train_vits-2.py
CHANGED
@@ -17,41 +17,6 @@ output_path = os.path.dirname(os.path.abspath(__file__))
|
|
17 |
|
18 |
|
19 |
|
20 |
-
def mozilla_with_speaker(root_path, meta_file, **kwargs):
|
21 |
-
"""Loades three kaggle datasets in Mozilla format as a multispeaker dataset
|
22 |
-
Kaggle datasets are:
|
23 |
-
magnoliasis/persian-tts-dataset-famale
|
24 |
-
magnoliasis/persian-tts-dataset
|
25 |
-
magnoliasis/persian-tts-dataset-male
|
26 |
-
|
27 |
-
This function is very usefull while using kaggle notebooks.
|
28 |
-
|
29 |
-
Args:
|
30 |
-
root_path (str): root folder where all three datasets downloaded. for example on kaggle notebooks: /kaggle/input
|
31 |
-
meta_files (str): list of meta files to be used in the training.
|
32 |
-
"""
|
33 |
-
dataset_names={
|
34 |
-
"persian-tts-dataset-famale":"dilara",
|
35 |
-
"persian-tts-dataset":"changiz",
|
36 |
-
"persian-tts-dataset-male":"farid"
|
37 |
-
}
|
38 |
-
items = []
|
39 |
-
for data_root_path in dataset_names.keys():
|
40 |
-
new_root_path=os.path.join(root_path,data_root_path)
|
41 |
-
txt_file = os.path.join(new_root_path, meta_file)
|
42 |
-
speaker_name = dataset_names[data_root_path]
|
43 |
-
print(speaker_name)
|
44 |
-
with open(txt_file, "r", encoding="utf-8") as ttf:
|
45 |
-
for line in ttf:
|
46 |
-
cols = line.split("|")
|
47 |
-
wav_file = cols[1].strip()
|
48 |
-
text = cols[0].strip()
|
49 |
-
wav_file = os.path.join(new_root_path, "wavs", wav_file)
|
50 |
-
items.append({"text": text, "audio_file": wav_file, "speaker_name": speaker_name, "root_path": new_root_path})
|
51 |
-
return items
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
|
56 |
|
57 |
|
|
|
17 |
|
18 |
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
|
22 |
|