适配windows
This commit is contained in:
20
bert_gen.py
20
bert_gen.py
@@ -5,7 +5,7 @@ import commons
|
|||||||
import utils
|
import utils
|
||||||
from data_utils import TextAudioSpeakerLoader, TextAudioSpeakerCollate
|
from data_utils import TextAudioSpeakerLoader, TextAudioSpeakerCollate
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
from multiprocessing import Pool
|
import warnings
|
||||||
|
|
||||||
from text import cleaned_text_to_sequence, get_bert
|
from text import cleaned_text_to_sequence, get_bert
|
||||||
|
|
||||||
@@ -40,14 +40,14 @@ def process_line(line):
|
|||||||
torch.save(bert, bert_path)
|
torch.save(bert, bert_path)
|
||||||
|
|
||||||
|
|
||||||
lines = []
|
if __name__ == '__main__':
|
||||||
with open(hps.data.training_files) as f:
|
lines = []
|
||||||
lines.extend(f.readlines())
|
with open(hps.data.training_files) as f:
|
||||||
|
lines.extend(f.readlines())
|
||||||
|
|
||||||
with open(hps.data.validation_files) as f:
|
with open(hps.data.validation_files) as f:
|
||||||
lines.extend(f.readlines())
|
lines.extend(f.readlines())
|
||||||
|
|
||||||
|
with Pool(processes=12) as pool: #A100 suitable config,if coom,please decrease the processess number.
|
||||||
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)):
|
||||||
for _ in tqdm(pool.imap_unordered(process_line, lines)):
|
pass
|
||||||
pass
|
|
||||||
|
|||||||
Reference in New Issue
Block a user