Commit
·
20abcf3
1
Parent(s):
1d6c3e3
loading script
Browse files- dusha_emotion_audio.py +6 -7
dusha_emotion_audio.py
CHANGED
@@ -51,15 +51,14 @@ class Dusha(datasets.GeneratorBasedBuilder):
|
|
51 |
next(csv_reader)
|
52 |
for row in csv_reader:
|
53 |
audio_path, label = row
|
54 |
-
full_audio_path = os.path.join(audio_files, audio_path)
|
55 |
res = dict()
|
56 |
-
res["file"] =
|
57 |
res["label"] = label
|
58 |
-
examples[
|
59 |
|
60 |
key = 0
|
61 |
for path, f in audio_files:
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
51 |
next(csv_reader)
|
52 |
for row in csv_reader:
|
53 |
audio_path, label = row
|
|
|
54 |
res = dict()
|
55 |
+
res["file"] = audio_path
|
56 |
res["label"] = label
|
57 |
+
examples[audio_path] = res
|
58 |
|
59 |
key = 0
|
60 |
for path, f in audio_files:
|
61 |
+
if path in examples:
|
62 |
+
audio = {"path": path, "bytes": f.read()}
|
63 |
+
yield key, {**examples[path], "audio": audio}
|
64 |
+
key += 1
|