1 Star 1 Fork 1

shana2010/whisper-vits-japanese

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
preprocess.py 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
AlexandaJerry 提交于 2022-08-12 01:47 . Initial commit
import argparse
import text
from utils import load_filepaths_and_text
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--out_extension", default="cleaned")
parser.add_argument("--text_index", default=1, type=int)
parser.add_argument("--filelists", nargs="+", default=["filelists/ljs_audio_text_val_filelist.txt", "filelists/ljs_audio_text_test_filelist.txt"])
parser.add_argument("--text_cleaners", nargs="+", default=["english_cleaners2"])
args = parser.parse_args()
for filelist in args.filelists:
print("START:", filelist)
filepaths_and_text = load_filepaths_and_text(filelist)
for i in range(len(filepaths_and_text)):
original_text = filepaths_and_text[i][args.text_index]
cleaned_text = text._clean_text(original_text, args.text_cleaners)
filepaths_and_text[i][args.text_index] = cleaned_text
new_filelist = filelist + "." + args.out_extension
with open(new_filelist, "w", encoding="utf-8") as f:
f.writelines(["|".join(x) + "\n" for x in filepaths_and_text])
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shana2010/whisper-vits-japanese.git
[email protected]:shana2010/whisper-vits-japanese.git
shana2010
whisper-vits-japanese
whisper-vits-japanese
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385