Update NURC-SP_ENTOA_TTS.py
Browse files- NURC-SP_ENTOA_TTS.py +17 -0
NURC-SP_ENTOA_TTS.py
CHANGED
@@ -85,6 +85,10 @@ class EntoaDataset(GeneratorBasedBuilder):
|
|
85 |
archive = dl_manager.download(_ARCHIVES[self.config.name])
|
86 |
prompts_path = dl_manager.download(prompts_urls)
|
87 |
|
|
|
|
|
|
|
|
|
88 |
return [
|
89 |
SplitGenerator(
|
90 |
name=Split.VALIDATION,
|
@@ -106,9 +110,15 @@ class EntoaDataset(GeneratorBasedBuilder):
|
|
106 |
|
107 |
def _generate_examples(self, prompts_path, path_to_clips, audio_files):
|
108 |
examples = {}
|
|
|
|
|
|
|
109 |
with open(prompts_path, "r") as f:
|
110 |
csv_reader = csv.DictReader(f)
|
111 |
for row in csv_reader:
|
|
|
|
|
|
|
112 |
if self.config.name == "prosodic":
|
113 |
examples[row['path']] = {
|
114 |
"path": row['path'],
|
@@ -151,9 +161,16 @@ class EntoaDataset(GeneratorBasedBuilder):
|
|
151 |
for path, f in audio_files:
|
152 |
if path.startswith(path_to_clips):
|
153 |
inside_clips_dir = True
|
|
|
|
|
|
|
|
|
154 |
if path in examples:
|
155 |
audio = {"path": path, "bytes": f.read()}
|
156 |
yield id_, {**examples[path], "audio": audio}
|
157 |
id_ += 1
|
158 |
elif inside_clips_dir:
|
159 |
break
|
|
|
|
|
|
|
|
85 |
archive = dl_manager.download(_ARCHIVES[self.config.name])
|
86 |
prompts_path = dl_manager.download(prompts_urls)
|
87 |
|
88 |
+
# Debug prints for downloaded paths
|
89 |
+
print(f"Downloaded prompts: {prompts_path}")
|
90 |
+
print(f"Downloaded archive: {archive}")
|
91 |
+
|
92 |
return [
|
93 |
SplitGenerator(
|
94 |
name=Split.VALIDATION,
|
|
|
110 |
|
111 |
def _generate_examples(self, prompts_path, path_to_clips, audio_files):
|
112 |
examples = {}
|
113 |
+
|
114 |
+
# Debug print for prompts path
|
115 |
+
print(f"Reading prompts from: {prompts_path}")
|
116 |
with open(prompts_path, "r") as f:
|
117 |
csv_reader = csv.DictReader(f)
|
118 |
for row in csv_reader:
|
119 |
+
# Debug print for row processing
|
120 |
+
print(f"Processing row: {row}")
|
121 |
+
|
122 |
if self.config.name == "prosodic":
|
123 |
examples[row['path']] = {
|
124 |
"path": row['path'],
|
|
|
161 |
for path, f in audio_files:
|
162 |
if path.startswith(path_to_clips):
|
163 |
inside_clips_dir = True
|
164 |
+
|
165 |
+
# Debug print for matching audio file
|
166 |
+
print(f"Found matching audio file: {path}")
|
167 |
+
|
168 |
if path in examples:
|
169 |
audio = {"path": path, "bytes": f.read()}
|
170 |
yield id_, {**examples[path], "audio": audio}
|
171 |
id_ += 1
|
172 |
elif inside_clips_dir:
|
173 |
break
|
174 |
+
|
175 |
+
# Debug print for completion
|
176 |
+
print(f"Completed generating examples. Total examples: {id_}")
|