Update misophoniaSounds.py
Browse files- misophoniaSounds.py +6 -6
misophoniaSounds.py
CHANGED
|
@@ -45,28 +45,28 @@ class Miso(datasets.GeneratorBasedBuilder):
|
|
| 45 |
datasets.SplitGenerator(
|
| 46 |
name=datasets.Split.TRAIN,
|
| 47 |
gen_kwargs={
|
| 48 |
-
"filepath": prompts_paths["train"],
|
| 49 |
"audio_files": dl_manager.iter_archive(audio_files),
|
|
|
|
| 50 |
},
|
| 51 |
),
|
| 52 |
datasets.SplitGenerator(
|
| 53 |
name=datasets.Split.TEST,
|
| 54 |
gen_kwargs={
|
| 55 |
-
"filepath": prompts_paths["test"],
|
| 56 |
"audio_files": dl_manager.iter_archive(audio_files),
|
|
|
|
| 57 |
},
|
| 58 |
),
|
| 59 |
]
|
| 60 |
-
def _generate_examples(self,
|
| 61 |
"""This function returns the examples in the raw (text) form."""
|
| 62 |
idx = 0
|
| 63 |
-
for
|
| 64 |
#label = filepath.split('/')[-1][:-4]
|
| 65 |
#description = description.replace('_', ' ')
|
| 66 |
-
label =
|
| 67 |
print(label)
|
| 68 |
yield idx, {
|
| 69 |
-
"audio": {"path":
|
| 70 |
"text": label,
|
| 71 |
}
|
| 72 |
idx += 1
|
|
|
|
| 45 |
datasets.SplitGenerator(
|
| 46 |
name=datasets.Split.TRAIN,
|
| 47 |
gen_kwargs={
|
|
|
|
| 48 |
"audio_files": dl_manager.iter_archive(audio_files),
|
| 49 |
+
"filepath": prompts_paths["train"],
|
| 50 |
},
|
| 51 |
),
|
| 52 |
datasets.SplitGenerator(
|
| 53 |
name=datasets.Split.TEST,
|
| 54 |
gen_kwargs={
|
|
|
|
| 55 |
"audio_files": dl_manager.iter_archive(audio_files),
|
| 56 |
+
"filepath": prompts_paths["test"],
|
| 57 |
},
|
| 58 |
),
|
| 59 |
]
|
| 60 |
+
def _generate_examples(self, audio_files):
|
| 61 |
"""This function returns the examples in the raw (text) form."""
|
| 62 |
idx = 0
|
| 63 |
+
for fpath, audio in audio_files:
|
| 64 |
#label = filepath.split('/')[-1][:-4]
|
| 65 |
#description = description.replace('_', ' ')
|
| 66 |
+
label = fpath.split(',')
|
| 67 |
print(label)
|
| 68 |
yield idx, {
|
| 69 |
+
"audio": {"path": fpath, "bytes": audio.read()},
|
| 70 |
"text": label,
|
| 71 |
}
|
| 72 |
idx += 1
|