holylovenia
commited on
Commit
•
16670b9
1
Parent(s):
4a4a681
Upload su_id_tts.py with huggingface_hub
Browse files- su_id_tts.py +14 -14
su_id_tts.py
CHANGED
@@ -5,14 +5,14 @@ from typing import List
|
|
5 |
|
6 |
import datasets
|
7 |
|
8 |
-
from
|
9 |
-
from
|
10 |
-
from
|
11 |
DEFAULT_SOURCE_VIEW_NAME, Tasks)
|
12 |
|
13 |
_DATASETNAME = "su_id_tts"
|
14 |
_SOURCE_VIEW_NAME = DEFAULT_SOURCE_VIEW_NAME
|
15 |
-
_UNIFIED_VIEW_NAME =
|
16 |
|
17 |
_LANGUAGES = ["sun"]
|
18 |
_LOCAL = False
|
@@ -47,25 +47,25 @@ _URLs = {
|
|
47 |
_SUPPORTED_TASKS = [Tasks.TEXT_TO_SPEECH]
|
48 |
|
49 |
_SOURCE_VERSION = "1.0.0"
|
50 |
-
|
51 |
|
52 |
|
53 |
class SuIdTTS(datasets.GeneratorBasedBuilder):
|
54 |
"""su_id_tts contains high-quality Multi-speaker TTS data for Sundanese (SU-ID)."""
|
55 |
|
56 |
BUILDER_CONFIGS = [
|
57 |
-
|
58 |
name="su_id_tts_source",
|
59 |
version=datasets.Version(_SOURCE_VERSION),
|
60 |
description="SU_ID_TTS source schema",
|
61 |
schema="source",
|
62 |
subset_id="su_id_tts",
|
63 |
),
|
64 |
-
|
65 |
-
name="
|
66 |
-
version=datasets.Version(
|
67 |
description="SU_ID_TTS Nusantara schema",
|
68 |
-
schema="
|
69 |
subset_id="su_id_tts",
|
70 |
),
|
71 |
]
|
@@ -84,7 +84,7 @@ class SuIdTTS(datasets.GeneratorBasedBuilder):
|
|
84 |
"gender": datasets.Value("string"),
|
85 |
}
|
86 |
)
|
87 |
-
elif self.config.schema == "
|
88 |
features = schemas.speech_text_features
|
89 |
|
90 |
return datasets.DatasetInfo(
|
@@ -112,7 +112,7 @@ class SuIdTTS(datasets.GeneratorBasedBuilder):
|
|
112 |
|
113 |
def _generate_examples(self, male_filepath: Path, female_filepath: Path):
|
114 |
|
115 |
-
if self.config.schema == "source" or self.config.schema == "
|
116 |
tsv_m = os.path.join(male_filepath, "su_id_male", "line_index.tsv")
|
117 |
tsv_f = os.path.join(female_filepath, "su_id_female", "line_index.tsv")
|
118 |
|
@@ -131,7 +131,7 @@ class SuIdTTS(datasets.GeneratorBasedBuilder):
|
|
131 |
}
|
132 |
yield line[0], ex
|
133 |
|
134 |
-
elif self.config.schema == "
|
135 |
ex = {
|
136 |
"id": line[0],
|
137 |
"speaker_id": spk_trans_info[0] + "_" + spk_trans_info[1],
|
@@ -160,7 +160,7 @@ class SuIdTTS(datasets.GeneratorBasedBuilder):
|
|
160 |
}
|
161 |
yield line[0], ex
|
162 |
|
163 |
-
elif self.config.schema == "
|
164 |
ex = {
|
165 |
"id": line[0],
|
166 |
"speaker_id": spk_trans_info[0] + "_" + spk_trans_info[1],
|
|
|
5 |
|
6 |
import datasets
|
7 |
|
8 |
+
from seacrowd.utils import schemas
|
9 |
+
from seacrowd.utils.configs import SEACrowdConfig
|
10 |
+
from seacrowd.utils.constants import (DEFAULT_SEACROWD_VIEW_NAME,
|
11 |
DEFAULT_SOURCE_VIEW_NAME, Tasks)
|
12 |
|
13 |
_DATASETNAME = "su_id_tts"
|
14 |
_SOURCE_VIEW_NAME = DEFAULT_SOURCE_VIEW_NAME
|
15 |
+
_UNIFIED_VIEW_NAME = DEFAULT_SEACROWD_VIEW_NAME
|
16 |
|
17 |
_LANGUAGES = ["sun"]
|
18 |
_LOCAL = False
|
|
|
47 |
_SUPPORTED_TASKS = [Tasks.TEXT_TO_SPEECH]
|
48 |
|
49 |
_SOURCE_VERSION = "1.0.0"
|
50 |
+
_SEACROWD_VERSION = "2024.06.20"
|
51 |
|
52 |
|
53 |
class SuIdTTS(datasets.GeneratorBasedBuilder):
|
54 |
"""su_id_tts contains high-quality Multi-speaker TTS data for Sundanese (SU-ID)."""
|
55 |
|
56 |
BUILDER_CONFIGS = [
|
57 |
+
SEACrowdConfig(
|
58 |
name="su_id_tts_source",
|
59 |
version=datasets.Version(_SOURCE_VERSION),
|
60 |
description="SU_ID_TTS source schema",
|
61 |
schema="source",
|
62 |
subset_id="su_id_tts",
|
63 |
),
|
64 |
+
SEACrowdConfig(
|
65 |
+
name="su_id_tts_seacrowd_sptext",
|
66 |
+
version=datasets.Version(_SEACROWD_VERSION),
|
67 |
description="SU_ID_TTS Nusantara schema",
|
68 |
+
schema="seacrowd_sptext",
|
69 |
subset_id="su_id_tts",
|
70 |
),
|
71 |
]
|
|
|
84 |
"gender": datasets.Value("string"),
|
85 |
}
|
86 |
)
|
87 |
+
elif self.config.schema == "seacrowd_sptext":
|
88 |
features = schemas.speech_text_features
|
89 |
|
90 |
return datasets.DatasetInfo(
|
|
|
112 |
|
113 |
def _generate_examples(self, male_filepath: Path, female_filepath: Path):
|
114 |
|
115 |
+
if self.config.schema == "source" or self.config.schema == "seacrowd_sptext":
|
116 |
tsv_m = os.path.join(male_filepath, "su_id_male", "line_index.tsv")
|
117 |
tsv_f = os.path.join(female_filepath, "su_id_female", "line_index.tsv")
|
118 |
|
|
|
131 |
}
|
132 |
yield line[0], ex
|
133 |
|
134 |
+
elif self.config.schema == "seacrowd_sptext":
|
135 |
ex = {
|
136 |
"id": line[0],
|
137 |
"speaker_id": spk_trans_info[0] + "_" + spk_trans_info[1],
|
|
|
160 |
}
|
161 |
yield line[0], ex
|
162 |
|
163 |
+
elif self.config.schema == "seacrowd_sptext":
|
164 |
ex = {
|
165 |
"id": line[0],
|
166 |
"speaker_id": spk_trans_info[0] + "_" + spk_trans_info[1],
|