From 5f35d9ffa6104195fe455e574ce9401d6a46c03c Mon Sep 17 00:00:00 2001 From: xin-w8023 Date: Wed, 10 Aug 2022 11:37:21 +0800 Subject: [PATCH] bug-fixed: fixed openrir data preparation process conflict. --- speechbrain/lobes/augment.py | 2 ++ speechbrain/utils/data_utils.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/speechbrain/lobes/augment.py b/speechbrain/lobes/augment.py index a59ee186ad..e5f6e26786 100644 --- a/speechbrain/lobes/augment.py +++ b/speechbrain/lobes/augment.py @@ -503,6 +503,8 @@ def _prepare_csv(folder, filelist, csv_file, max_length=None): than this will be cut into pieces. """ try: + # make sure all processing reached here before main preocess create csv_file + sb.distributed.ddp_barrier() if sb.utils.distributed.if_main_process(): with open(csv_file, "w") as w: w.write("ID,duration,wav,wav_format,wav_opts\n\n") diff --git a/speechbrain/utils/data_utils.py b/speechbrain/utils/data_utils.py index 37a46b84ed..e28b2e5fa4 100644 --- a/speechbrain/utils/data_utils.py +++ b/speechbrain/utils/data_utils.py @@ -299,6 +299,8 @@ def download_file( If True, replaces the existing files. """ try: + # make sure all processing reached here before main preocess create dest_dir + sb.distributed.ddp_barrier() if sb.utils.distributed.if_main_process(): class DownloadProgressBar(tqdm.tqdm):