Skip to content

Commit 158da7a

Browse files
committed
turn on multiprocessing
1 parent 7545d6c commit 158da7a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

preprocess.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def load_wavs(wav_dir, sr):
2828

2929
wav_dir_path = wav_dir
3030

31-
pool = multiprocessing.Pool(4)
31+
pool = multiprocessing.Pool(3)
3232

3333
wav_files = [x for x in os.listdir(wav_dir) if x.endswith('.wav')]
3434

@@ -92,9 +92,9 @@ def world_encode_data(wavs, fs, frame_period=5.0, coded_dim=24):
9292
FRAME_PERIOD = frame_period
9393
CODED_DIM = coded_dim
9494

95-
pool = multiprocessing.Pool(6)
95+
pool = multiprocessing.Pool(4)
9696

97-
results = list(tqdm.tqdm(map(encode_wav, wavs), total=len(wavs)))
97+
results = list(tqdm.tqdm(pool.imap_unordered(encode_wav, wavs), total=len(wavs)))
9898

9999
pool.close()
100100

0 commit comments

Comments
 (0)