mirror of
https://github.com/svc-develop-team/so-vits-svc.git
synced 2025-01-09 04:27:31 +08:00
Update preprocess_flist_config.py
This commit is contained in:
parent
0f5847a64c
commit
d07d92b61a
@ -4,7 +4,7 @@ import os
|
||||
import re
|
||||
import wave
|
||||
from random import shuffle
|
||||
|
||||
from loguru import logger
|
||||
from tqdm import tqdm
|
||||
|
||||
import diffusion.logger.utils as du
|
||||
@ -46,9 +46,9 @@ if __name__ == "__main__":
|
||||
if not file.endswith("wav"):
|
||||
continue
|
||||
if not pattern.match(file):
|
||||
print(f"warning:文件名{file}中包含非字母数字下划线,可能会导致错误。(也可能不会)")
|
||||
logger.warning(f"文件名{file}中包含非字母数字下划线,可能会导致错误。(也可能不会)")
|
||||
if get_wav_duration(file) < 0.3:
|
||||
print("skip too short audio:", file)
|
||||
logger.info("Skip too short audio:" + file)
|
||||
continue
|
||||
new_wavs.append(file)
|
||||
wavs = new_wavs
|
||||
@ -59,13 +59,13 @@ if __name__ == "__main__":
|
||||
shuffle(train)
|
||||
shuffle(val)
|
||||
|
||||
print("Writing", args.train_list)
|
||||
logger.info("Writing" + args.train_list)
|
||||
with open(args.train_list, "w") as f:
|
||||
for fname in tqdm(train):
|
||||
wavpath = fname
|
||||
f.write(wavpath + "\n")
|
||||
|
||||
print("Writing", args.val_list)
|
||||
logger.info("Writing" + args.val_list)
|
||||
with open(args.val_list, "w") as f:
|
||||
for fname in tqdm(val):
|
||||
wavpath = fname
|
||||
@ -97,8 +97,8 @@ if __name__ == "__main__":
|
||||
if args.vol_aug:
|
||||
config_template["train"]["vol_aug"] = config_template["model"]["vol_embedding"] = True
|
||||
|
||||
print("Writing configs/config.json")
|
||||
logger.info("Writing to configs/config.json")
|
||||
with open("configs/config.json", "w") as f:
|
||||
json.dump(config_template, f, indent=2)
|
||||
print("Writing configs/diffusion.yaml")
|
||||
logger.info("Writing to configs/diffusion.yaml")
|
||||
du.save_config("configs/diffusion.yaml",d_config_template)
|
||||
|
Loading…
Reference in New Issue
Block a user