anton-l HF staff lhoestq HF staff commited on
Commit
cdccd9a
1 Parent(s): 56717e3

fix memory issue (#1)

Browse files

- fix memory issue (fe98e145316cf6e8f6a112ffdeb5cb9a6680fa7a)


Co-authored-by: Quentin Lhoest <[email protected]>

Files changed (1) hide show
  1. dataset_script.py +1 -1
dataset_script.py CHANGED
@@ -250,7 +250,7 @@ class CommonVoice(datasets.GeneratorBasedBuilder):
250
  if not metadata:
251
  break
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()}
 
250
  if not metadata:
251
  break
252
  if path in metadata:
253
+ result = dict(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()}