Skip to content

Commit 76653b5

Browse files
Stardust-minusOedoSoldierlitagin02jiangyuxiaoxiaoNaruseMioShirakana
authored
Dev 2.3. (#242)
* Fix inputs of duration discriminator * Add LSTM * Update models.py * Update tensorboard scalar * Noise injection for minimizing modality gap * Update infer.py * support bf16 run * del unused_para flag * support bf16 config * add grad clip * fix(logger and grad):add dur grad,fix grad clip * Update webui_preprocess.py * Fix English G2P * fix(bert_gen):add pass * Pass SDP to DD * Update webui_preprocess.py * Update config.json * Update webui.py * Update chinese_bert.py * Upload webui for deploy * Update webui.py * torch.save as pt not npy * Update config.json * add freeze emo vq * Update webui_preprocess.py * Fix tone_sandhi.py * Comment up grad clip * Fix in-place addition * Add SLM discriminator * Add DDP for WD * Feat: Style text: make emotions and style similar to the style text by mixing bert (#240) (#241) * fix:(oldVersion210) Load on demand Emotion model * feat: update fastapi.py. 添加更多错误日志信息 * Switch pyopenjtalk to pyopenjtalk-prebuilt * fix: update fastapi.py. 2.2 reference适配 * Update resample.py * 修复Onnx导出的BUG (#237) * Add files via upload * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add files via upload * Add files via upload * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Delete attentions_onnx.py * Delete models_onnx.py * Add files via upload * Add files via upload * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update __init__.py * Update __init__.py * Update __init__.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- * Fix onnx * Format export * Feat: style-text and bert mixing (JA only) * Ensure the same tensor shape * Update * update gradio version * Fix * Style text for chinese and english (ver 2.2) * Style text for chinese and english (ver 2.1) * Style text in FastAPI * Translate style text desc in chinese --------- Co-authored-by: litagin02 <[email protected]> Co-authored-by: Sora <[email protected]> Co-authored-by: Sihan Wang <[email protected]> Co-authored-by: Ναρουσέ·μ·γιουμεμί·Χινακάννα <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Remove CLAP * Revert "Remove CLAP" This reverts commit 62fd59b. Revert * Remove CLAP * bf16 audo grad cilp * Update webui and infer utils * Update webui.py * Update webui.py * Update webui-preprocess.py * Update webui_preprocess.py --------- Co-authored-by: Sihan Wang <[email protected]> Co-authored-by: OedoSoldier <[email protected]> Co-authored-by: litagin02 <[email protected]> Co-authored-by: Sora <[email protected]> Co-authored-by: Ναρουσέ·μ·γιουμεμί·Χινακάννα <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 5479e90 commit 76653b5

34 files changed

+2960
-1208
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ data/*
170170
!/default_config.yml
171171
/Web/
172172
/emotional/*/*.bin
173+
/slm/*/*.bin
173174
/bert/*/*.bin
174175
/bert/*/*.h5
175176
/bert/*/*.model

bert_gen.py

+24-17
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
import argparse
2-
from multiprocessing import Pool, cpu_count
3-
41
import torch
5-
import torch.multiprocessing as mp
6-
from tqdm import tqdm
7-
2+
from multiprocessing import Pool
83
import commons
94
import utils
5+
from tqdm import tqdm
6+
from text import check_bert_models, cleaned_text_to_sequence, get_bert
7+
import argparse
8+
import torch.multiprocessing as mp
109
from config import config
11-
from text import cleaned_text_to_sequence, get_bert
1210

1311

14-
def process_line(line):
12+
def process_line(x):
13+
line, add_blank = x
1514
device = config.bert_gen_config.device
1615
if config.bert_gen_config.use_multi_device:
1716
rank = mp.current_process()._identity
@@ -28,12 +27,13 @@ def process_line(line):
2827
word2ph = [i for i in word2ph]
2928
phone, tone, language = cleaned_text_to_sequence(phone, tone, language_str)
3029

31-
phone = commons.intersperse(phone, 0)
32-
tone = commons.intersperse(tone, 0)
33-
language = commons.intersperse(language, 0)
34-
for i in range(len(word2ph)):
35-
word2ph[i] = word2ph[i] * 2
36-
word2ph[0] += 1
30+
if add_blank:
31+
phone = commons.intersperse(phone, 0)
32+
tone = commons.intersperse(tone, 0)
33+
language = commons.intersperse(language, 0)
34+
for i in range(len(word2ph)):
35+
word2ph[i] = word2ph[i] * 2
36+
word2ph[0] += 1
3737

3838
bert_path = wav_path.replace(".WAV", ".wav").replace(".wav", ".bert.pt")
3939

@@ -59,16 +59,23 @@ def process_line(line):
5959
args, _ = parser.parse_known_args()
6060
config_path = args.config
6161
hps = utils.get_hparams_from_file(config_path)
62+
check_bert_models()
6263
lines = []
6364
with open(hps.data.training_files, encoding="utf-8") as f:
6465
lines.extend(f.readlines())
6566

6667
with open(hps.data.validation_files, encoding="utf-8") as f:
6768
lines.extend(f.readlines())
69+
add_blank = [hps.data.add_blank] * len(lines)
70+
6871
if len(lines) != 0:
69-
num_processes = min(args.num_processes, cpu_count())
72+
num_processes = args.num_processes
7073
with Pool(processes=num_processes) as pool:
71-
for _ in tqdm(pool.imap_unordered(process_line, lines), total=len(lines)):
72-
pass
74+
for _ in tqdm(
75+
pool.imap_unordered(process_line, zip(lines, add_blank)),
76+
total=len(lines),
77+
):
78+
# 这里是缩进的代码块,表示循环体
79+
pass # 使用pass语句作为占位符
7380

7481
print(f"bert生成完毕!, 共有{len(lines)}个bert.pt生成!")

clap_gen.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def process_line(line):
2727
device = torch.device("cpu")
2828
wav_path, _, language_str, text, phones, tone, word2ph = line.strip().split("|")
2929

30-
clap_path = wav_path.replace(".WAV", ".wav").replace(".wav", ".emo.npy")
30+
clap_path = wav_path.replace(".WAV", ".wav").replace(".wav", ".emo.pt")
3131
if os.path.isfile(clap_path):
3232
return
3333

0 commit comments

Comments
 (0)