diff --git a/egs/librispeech/asr/simple_v1/prepare.py b/egs/librispeech/asr/simple_v1/prepare.py index d0971db6..0f688bcd 100755 --- a/egs/librispeech/asr/simple_v1/prepare.py +++ b/egs/librispeech/asr/simple_v1/prepare.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +import multiprocessing import os from concurrent.futures import ProcessPoolExecutor from pathlib import Path @@ -37,14 +38,14 @@ num_jobs = 1 for partition, manifests in librispeech_manifests.items(): print(partition) - with LilcomFilesWriter(f'{output_dir}/feats_{partition}' - ) as storage, ProcessPoolExecutor(num_jobs) as ex: + with LilcomFilesWriter(f'{output_dir}/feats_{partition}') as storage, \ + ProcessPoolExecutor(num_jobs, mp_context=multiprocessing.get_context("spawn")) as ex: cut_set = CutSet.from_manifests( recordings=manifests['recordings'], supervisions=manifests['supervisions']).compute_and_store_features( extractor=Fbank(), storage=storage, - augmenter=augmenter if 'train' in partition else None, + augment_fn=augmenter if 'train' in partition else None, executor=ex) librispeech_manifests[partition]['cuts'] = cut_set cut_set.to_json(output_dir + f'/cuts_{partition}.json.gz')