Fix: colab stdout error, so replace with stdout wrapper

This commit is contained in:
litagin02
2023-12-30 09:58:32 +09:00
parent f1441c35f2
commit 35a8bb514f
9 changed files with 20 additions and 16 deletions

View File

@@ -1,6 +1,5 @@
import argparse
import os
import sys
from multiprocessing import Pool, cpu_count
import librosa
@@ -10,6 +9,7 @@ from tqdm import tqdm
from config import config
from tools.log import logger
from tools.stdout_wrapper import get_stdout
def normalize_audio(data, sr):
@@ -88,7 +88,7 @@ if __name__ == "__main__":
pool = Pool(processes=processes)
for _ in tqdm(
pool.imap_unordered(process, tasks), file=sys.stdout, total=len(tasks)
pool.imap_unordered(process, tasks), file=get_stdout(), total=len(tasks)
):
pass