AymanElmar commited on
Commit ·
ee8cb2c
1
Parent(s): 1b9f6f1
targz
Browse files
joha.py
CHANGED
|
@@ -148,16 +148,17 @@ class johaDataset(datasets.GeneratorBasedBuilder):
|
|
| 148 |
break
|
| 149 |
for path, f in archive_iterator2:
|
| 150 |
print("path", path)
|
|
|
|
| 151 |
if path in all_field_values:
|
| 152 |
|
| 153 |
# retrieve the metadata corresponding to this audio file
|
| 154 |
field_values = all_field_values[path]
|
|
|
|
| 155 |
|
| 156 |
result = {key: value for key, value in zip(data_fields, field_values)}
|
| 157 |
|
| 158 |
-
|
| 159 |
-
result["audio"] = {"path": path, "bytes": f.read()}
|
| 160 |
# set path to None if the audio file doesn't exist locally (i.e. in streaming mode)
|
| 161 |
-
file_name=path
|
| 162 |
|
| 163 |
-
yield
|
|
|
|
|
|
| 148 |
break
|
| 149 |
for path, f in archive_iterator2:
|
| 150 |
print("path", path)
|
| 151 |
+
id_=0
|
| 152 |
if path in all_field_values:
|
| 153 |
|
| 154 |
# retrieve the metadata corresponding to this audio file
|
| 155 |
field_values = all_field_values[path]
|
| 156 |
+
audio= {"path": path, "bytes": f.read()}
|
| 157 |
|
| 158 |
result = {key: value for key, value in zip(data_fields, field_values)}
|
| 159 |
|
| 160 |
+
|
|
|
|
| 161 |
# set path to None if the audio file doesn't exist locally (i.e. in streaming mode)
|
|
|
|
| 162 |
|
| 163 |
+
yield id_, {**all_field_values[path], "audio": audio}
|
| 164 |
+
id_+=1
|