Update magnatagatune.py
Browse files- magnatagatune.py +4 -4
magnatagatune.py
CHANGED
@@ -193,13 +193,13 @@ class MagnaTagATune(datasets.GeneratorBasedBuilder):
|
|
193 |
class_ = [index2class.get(idx) for idx in class_]
|
194 |
fileid2class[fileid] = class_
|
195 |
|
196 |
-
logger.info(fileid2class)
|
197 |
for guid, audio_path in enumerate(_walker):
|
198 |
-
parent = Path(audio_path).parent
|
199 |
filename = Path(audio_path).name
|
200 |
-
|
|
|
201 |
continue
|
202 |
-
tags = fileid2class.get(
|
203 |
yield guid, {
|
204 |
"id": str(guid),
|
205 |
"file": audio_path,
|
|
|
193 |
class_ = [index2class.get(idx) for idx in class_]
|
194 |
fileid2class[fileid] = class_
|
195 |
|
|
|
196 |
for guid, audio_path in enumerate(_walker):
|
197 |
+
parent = Path(audio_path).parent.stem
|
198 |
filename = Path(audio_path).name
|
199 |
+
fileid = f"{parent}/{filename}"
|
200 |
+
if fileid not in fileid2class:
|
201 |
continue
|
202 |
+
tags = fileid2class.get(fileid)
|
203 |
yield guid, {
|
204 |
"id": str(guid),
|
205 |
"file": audio_path,
|