From d81876c456382857faceaf892de18f6b1d6bace0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stardust=C2=B7=E5=87=8F?= Date: Sun, 3 Sep 2023 00:42:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8Dwindows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bert_gen.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bert_gen.py b/bert_gen.py index d873223..1087095 100644 --- a/bert_gen.py +++ b/bert_gen.py @@ -5,7 +5,7 @@ import commons import utils from data_utils import TextAudioSpeakerLoader, TextAudioSpeakerCollate from tqdm import tqdm -from multiprocessing import Pool +import warnings from text import cleaned_text_to_sequence, get_bert @@ -40,14 +40,14 @@ def process_line(line): torch.save(bert, bert_path) -lines = [] -with open(hps.data.training_files) as f: - lines.extend(f.readlines()) +if __name__ == '__main__': + lines = [] + with open(hps.data.training_files) as f: + lines.extend(f.readlines()) -with open(hps.data.validation_files) as f: - lines.extend(f.readlines()) + with open(hps.data.validation_files) as f: + lines.extend(f.readlines()) - -with Pool(processes=12) as pool: #A100 suitable config,if coom,please decrease the processess number. - for _ in tqdm(pool.imap_unordered(process_line, lines)): - pass + with Pool(processes=12) as pool: #A100 suitable config,if coom,please decrease the processess number. + for _ in tqdm(pool.imap_unordered(process_line, lines)): + pass