diff --git a/egs/librispeech/asr/simple_v1/prepare.py b/egs/librispeech/asr/simple_v1/prepare.py index 95758a74..84bb04ed 100755 --- a/egs/librispeech/asr/simple_v1/prepare.py +++ b/egs/librispeech/asr/simple_v1/prepare.py @@ -3,6 +3,7 @@ # Copyright (c) 2020 Xiaomi Corporation (authors: Junbo Zhang, Haowen Qiu) # Apache 2.0 +import multiprocessing import os from concurrent.futures import ProcessPoolExecutor from pathlib import Path @@ -39,8 +40,8 @@ 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(