Skip to content

Commit e165b50

Browse files
authored
Fix parallel related issues
1 parent bdea1f8 commit e165b50

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sdp/processors/manage_files/utils/convert_to_tarred_audio_dataset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989

9090
import numpy as np
9191
import soundfile as sf
92-
from joblib import Parallel, delayed
92+
from joblib import Parallel, delayed, parallel_backend
9393
from omegaconf import DictConfig, OmegaConf, open_dict
9494
from tabulate import tabulate
9595
from tqdm import tqdm
@@ -292,7 +292,7 @@ def create_new_dataset(
292292

293293
manifest_folder, _ = os.path.split(manifest_path)
294294

295-
with parallel_backend(backend, n_jobs=num_workers):
295+
with parallel_backend(PARALLEL_BACKEND, n_jobs=num_workers):
296296
new_entries_list = Parallel(verbose=config.num_shards)(
297297
delayed(self._create_shard)(entries[start_idx:end_idx], target_dir, i, manifest_folder, only_manifests)
298298
for i, (start_idx, end_idx) in enumerate(zip(start_indices, end_indices))
@@ -495,7 +495,7 @@ def create_concatenated_dataset(
495495

496496
manifest_folder, _ = os.path.split(base_manifest_path)
497497

498-
with parallel_backend(backend, n_jobs=num_workers):
498+
with parallel_backend(PARALLEL_BACKEND, n_jobs=num_workers):
499499
new_entries_list = Parallel(verbose=config.num_shards)(
500500
delayed(self._create_shard)(
501501
entries[start_idx:end_idx], target_dir, shard_idx, manifest_folder, only_manifests

0 commit comments

Comments
 (0)