Datasets:
Adjust loading script
Browse files- fleurs-hs-vits.py +7 -27
fleurs-hs-vits.py
CHANGED
@@ -52,16 +52,9 @@ class FLEURSHSVITSConfig(BuilderConfig):
|
|
52 |
**kwargs,
|
53 |
)
|
54 |
|
55 |
-
if self.name.endswith("_without-human"):
|
56 |
-
self.without_human = True
|
57 |
-
self.language = "_".join(self.name.split("_")[:-1])
|
58 |
-
else:
|
59 |
-
self.without_human = False
|
60 |
-
self.language = self.name
|
61 |
-
|
62 |
|
63 |
class FLEURSHSVITSDataset(GeneratorBasedBuilder):
|
64 |
-
DEFAULT_CONFIG_NAME = "
|
65 |
|
66 |
BUILDER_CONFIGS = [
|
67 |
FLEURSHSVITSConfig(name=name)
|
@@ -74,21 +67,13 @@ class FLEURSHSVITSDataset(GeneratorBasedBuilder):
|
|
74 |
"nl_nl",
|
75 |
"pl_pl",
|
76 |
"sv_se",
|
77 |
-
"de_de_without-human",
|
78 |
-
"en_us_without-human",
|
79 |
-
"es_419_without-human",
|
80 |
-
"fr_fr_without-human",
|
81 |
-
"it_it_without-human",
|
82 |
-
"nl_nl_without-human",
|
83 |
-
"pl_pl_without-human",
|
84 |
-
"sv_se_without-human",
|
85 |
)
|
86 |
]
|
87 |
|
88 |
def get_audio_archive_path(
|
89 |
self,
|
90 |
) -> Path:
|
91 |
-
return Path("data") / self.config.
|
92 |
|
93 |
def _info(self) -> DatasetInfo:
|
94 |
return DatasetInfo(
|
@@ -142,17 +127,12 @@ class FLEURSHSVITSDataset(GeneratorBasedBuilder):
|
|
142 |
) -> Iterable[Tuple[int, Dict[str, Any]]]:
|
143 |
current_index = 0
|
144 |
for audio_path, audio_file in archive_iterable:
|
145 |
-
|
146 |
-
|
147 |
-
if not self.config.without_human or label == "human":
|
148 |
-
audio = {
|
149 |
"path": audio_path,
|
150 |
"bytes": audio_file.read(),
|
151 |
-
}
|
152 |
-
|
153 |
-
|
154 |
-
"audio": audio,
|
155 |
-
"label": label,
|
156 |
-
}
|
157 |
|
158 |
current_index += 1
|
|
|
52 |
**kwargs,
|
53 |
)
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
class FLEURSHSVITSDataset(GeneratorBasedBuilder):
|
57 |
+
DEFAULT_CONFIG_NAME = "en_us"
|
58 |
|
59 |
BUILDER_CONFIGS = [
|
60 |
FLEURSHSVITSConfig(name=name)
|
|
|
67 |
"nl_nl",
|
68 |
"pl_pl",
|
69 |
"sv_se",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
)
|
71 |
]
|
72 |
|
73 |
def get_audio_archive_path(
|
74 |
self,
|
75 |
) -> Path:
|
76 |
+
return Path("data") / self.config.name / "splits" / "test.tar.gz"
|
77 |
|
78 |
def _info(self) -> DatasetInfo:
|
79 |
return DatasetInfo(
|
|
|
127 |
) -> Iterable[Tuple[int, Dict[str, Any]]]:
|
128 |
current_index = 0
|
129 |
for audio_path, audio_file in archive_iterable:
|
130 |
+
yield current_index, {
|
131 |
+
"audio": {
|
|
|
|
|
132 |
"path": audio_path,
|
133 |
"bytes": audio_file.read(),
|
134 |
+
},
|
135 |
+
"label": "synthetic",
|
136 |
+
}
|
|
|
|
|
|
|
137 |
|
138 |
current_index += 1
|