polinaeterna
commited on
Commit
·
6647e43
1
Parent(s):
a13606b
store path to local audio file instead of bytes
Browse files- dataset_script.py +3 -1
dataset_script.py
CHANGED
@@ -252,7 +252,9 @@ class CommonVoice(datasets.GeneratorBasedBuilder):
|
|
252 |
if path in metadata:
|
253 |
result = metadata[path]
|
254 |
# set the audio feature and the path to the extracted file
|
|
|
255 |
result["audio"] = {"path": path, "bytes": f.read()}
|
256 |
-
|
|
|
257 |
|
258 |
yield path, result
|
|
|
252 |
if path in metadata:
|
253 |
result = metadata[path]
|
254 |
# set the audio feature and the path to the extracted file
|
255 |
+
path = os.path.join(local_extracted_archive, path) if local_extracted_archive else path
|
256 |
result["audio"] = {"path": path, "bytes": f.read()}
|
257 |
+
# set path to None if the audio file doesn't exist locally (i.e. in streaming mode)
|
258 |
+
result["path"] = path if local_extracted_archive else None
|
259 |
|
260 |
yield path, result
|