Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master #232

Closed
wants to merge 118 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
ca546c5
Update server_fastapi.py. Add new api endpoints. (#141)
jiangyuxiaoxiao Nov 1, 2023
74467f5
修复多机训练问题 (#143)
Lvjinhong Nov 2, 2023
6227012
[Fix] Fix Volume inconsistent (#144)
lzyplayer Nov 2, 2023
7737079
Update webui.py
Stardust-minus Nov 2, 2023
25ea864
Update server_fastapi.py. Avoid loading the model repeatedly. Add log…
jiangyuxiaoxiao Nov 3, 2023
d4ecc90
更新 models.py
Stardust-minus Nov 3, 2023
4d6de24
Fix: server_fastapi.py. (#147)
jiangyuxiaoxiao Nov 3, 2023
8609449
Auto download missing model for `bert_gen.py` (#146)
Isotr0py Nov 3, 2023
3705de9
修复部分日文汉字无法被推理/训练 (#148)
Minami-su Nov 4, 2023
1da0189
Update mel_processing.py
Stardust-minus Nov 5, 2023
b99419d
Update server.py
Stardust-minus Nov 5, 2023
7e41a1c
Update server.py
Stardust-minus Nov 5, 2023
5c74e9a
更新 japanese.py,修正bug
Stardust-minus Nov 5, 2023
a4907cd
Update server.py
Stardust-minus Nov 5, 2023
6d1fa77
Update requirements.txt
Stardust-minus Nov 5, 2023
a3f981d
Update server.py
Stardust-minus Nov 5, 2023
321b72c
Update server.py
Stardust-minus Nov 5, 2023
6d0d777
Update server.py
Stardust-minus Nov 5, 2023
0dbe362
Fix japanese.py (#151)
OedoSoldier Nov 5, 2023
80c418e
Add model download to `train_ms.py` (#150)
Isotr0py Nov 5, 2023
5f14fa1
Update server.py
Stardust-minus Nov 6, 2023
8557742
Update README.md
Stardust-minus Nov 6, 2023
096d661
Fix: server_fastapi.py, support auto split (#152)
jiangyuxiaoxiao Nov 6, 2023
c86da6e
Add language identification. (#153)
Artrajz Nov 6, 2023
a233fb4
[pre-commit.ci] pre-commit autoupdate (#154)
pre-commit-ci[bot] Nov 7, 2023
a752307
Update zje language identification. (#155)
Artrajz Nov 7, 2023
16af947
add emo and vo
Stardust-minus Nov 7, 2023
5980503
Update models.py
Stardust-minus Nov 7, 2023
c864828
add emo
Stardust-minus Nov 7, 2023
8ea241b
Update loss
Stardust-minus Nov 7, 2023
9616b7b
Create emo_gen.py
Stardust-minus Nov 7, 2023
709edb1
Update README.md
Stardust-minus Nov 7, 2023
2c2b7e8
更新 bert_models.json
Stardust-minus Nov 7, 2023
d99b4bd
fix
Stardust-minus Nov 7, 2023
17ae5b9
Update data_utils.py
Stardust-minus Nov 7, 2023
03b2ec0
Update infer.py
Stardust-minus Nov 7, 2023
af7b0ea
performance improve
Stardust-minus Nov 7, 2023
ee423f2
Feat: support auto split in webui (#158)
jiangyuxiaoxiao Nov 8, 2023
33d1535
sync emo branch (#159)
Stardust-minus Nov 8, 2023
6a77c8b
Fix: change /voice api to post (#160)
jiangyuxiaoxiao Nov 8, 2023
6e66fec
Fix: Add missing torch.cuda.empty_cache() (#161)
Artrajz Nov 8, 2023
695ac42
Merge branch 'dev-emo' into master
Stardust-minus Nov 8, 2023
242428f
del emo
Stardust-minus Nov 8, 2023
78677dd
del emo
Stardust-minus Nov 8, 2023
f15f083
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 8, 2023
653a186
Update data_utils.py
Stardust-minus Nov 9, 2023
c137d87
use diy loguru (#164)
jiangyuxiaoxiao Nov 9, 2023
33c1e29
Update README.md
Stardust-minus Nov 9, 2023
1144814
更新 models.py
Stardust-minus Nov 10, 2023
3aacd2c
Update default_config.yml
Stardust-minus Nov 10, 2023
3a332fc
"config_path" not "config" (#170)
Miuzarte Nov 11, 2023
3a83ea1
Update default_config.yml
Stardust-minus Nov 11, 2023
5c37dbd
Onnx导出 (#176)
NaruseMioShirakana Nov 11, 2023
9483a6c
Fix: roll back #170 and fix bug in api /tools/random_example (#177)
jiangyuxiaoxiao Nov 11, 2023
52f895a
[pre-commit.ci] pre-commit autoupdate (#180)
pre-commit-ci[bot] Nov 14, 2023
ad694ee
Skip SOS and EOS when processing sliced sentances (#179)
OedoSoldier Nov 14, 2023
1fbddf4
Support multilang generation (#185)
OedoSoldier Nov 15, 2023
31de84e
更新并完善分布式训练功能 (#186)
Lvjinhong Nov 16, 2023
ec9145c
[pre-commit.ci] pre-commit autoupdate (#189)
pre-commit-ci[bot] Nov 21, 2023
b186499
Dev emo (#171)
Stardust-minus Nov 25, 2023
a2d9718
Add files via upload
Stardust-minus Nov 25, 2023
3dc93c9
Add files via upload
Stardust-minus Nov 25, 2023
3ec1b65
Update README.md
Stardust-minus Nov 25, 2023
64e5746
Update infer.py
Stardust-minus Nov 25, 2023
b24d407
Update config.json
Stardust-minus Nov 25, 2023
9e409e2
Rename esd.list to sample.list
Stardust-minus Nov 25, 2023
1dec0d3
Update default_config.yml
Stardust-minus Nov 25, 2023
f28f105
Update README.md
Stardust-minus Nov 25, 2023
6d6ba62
Update README.md
Stardust-minus Nov 25, 2023
4b23d4d
Update data_utils.py
Stardust-minus Nov 25, 2023
65cf40f
Update data_utils.py
Stardust-minus Nov 25, 2023
f65b332
Update train_ms.py
Stardust-minus Nov 25, 2023
8e28d5e
Update default_config.yml
Stardust-minus Nov 25, 2023
241c6e4
Update config.py
Stardust-minus Nov 25, 2023
afa21ff
Update webui.py
Stardust-minus Nov 25, 2023
2e73312
fix emo
Stardust-minus Nov 25, 2023
4158626
Update infer.py
Stardust-minus Nov 26, 2023
2c7d3f5
Delete server.py
Stardust-minus Nov 26, 2023
11e3b16
Update infer.py
Stardust-minus Nov 26, 2023
15babcd
fix: Fix wrong reference of function name: change ref to reference_au…
jsoncode Nov 26, 2023
dec3fc0
Auto download update, optimize dataloader `num_workers` (#195)
Isotr0py Nov 26, 2023
1952bcd
Update infer.py
Stardust-minus Nov 27, 2023
5ec036a
Update infer.py
Stardust-minus Nov 27, 2023
122afe0
Update infer.py (#196)
OedoSoldier Nov 27, 2023
818b3b1
Update infer.py (#197)
OedoSoldier Nov 27, 2023
8ef5db5
Update infer.py
OedoSoldier Nov 27, 2023
2c528ce
Merge pull request #198 from OedoSoldier/master
OedoSoldier Nov 27, 2023
badb125
Change the utils.download_emo_models (#199)
Thymustw Nov 27, 2023
982ea7d
Update
OedoSoldier Nov 27, 2023
0dd8183
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 27, 2023
e92f67f
Merge pull request #200 from OedoSoldier/master
OedoSoldier Nov 27, 2023
edb5d05
Fix multiprocess (#201)
Isotr0py Nov 28, 2023
f5444c2
fix server_fastapi.py: 解决可能的BytesIO()未被回收导致内存泄露的问题,适配310以下版本python (#…
jiangyuxiaoxiao Nov 28, 2023
46fcdf4
更新 webui.py
Stardust-minus Nov 29, 2023
4edcfb3
text/init.py (#203)
AnyaCoder Nov 30, 2023
377454b
assure 'configs/config.json' is same (#205)
AnyaCoder Nov 30, 2023
9243818
default_config.yml : 'config.json' (#207)
AnyaCoder Nov 30, 2023
d4a2bc2
delete 4 files not required (#208)
AnyaCoder Nov 30, 2023
95f44ed
update server_fastapi.py: 缺少web文件时添加提示信息。configyml添加更多帮助注释
jiangyuxiaoxiao Dec 1, 2023
b4d7bc5
Merge pull request #210 from jiangyuxiaoxiao/master
jiangyuxiaoxiao Dec 1, 2023
2c50b78
Optimize the recognition of mixed Chinese and English characters in n…
Artrajz Dec 1, 2023
3623eed
update server_fastapi.py: 添加2.1模型推理支持。
jiangyuxiaoxiao Dec 3, 2023
872e8cb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 3, 2023
67de3ba
Merge pull request #213 from jiangyuxiaoxiao/master
jiangyuxiaoxiao Dec 3, 2023
2b178ba
fix server_fastapi.py: 修复bug。
jiangyuxiaoxiao Dec 4, 2023
15603dc
Merge pull request #214 from jiangyuxiaoxiao/master
jiangyuxiaoxiao Dec 4, 2023
c2fcc02
Update requirements.txt
Stardust-minus Dec 4, 2023
a4f3388
update server_fastapi.py. 模型文件不存在时跳过加载模型
jiangyuxiaoxiao Dec 6, 2023
87462fe
Merge pull request #215 from jiangyuxiaoxiao/master
jiangyuxiaoxiao Dec 6, 2023
f550f86
修复了VQ未注册入网络的问题 (#216)
NaruseMioShirakana Dec 7, 2023
7ddc560
Use only one vq is enough
OedoSoldier Dec 7, 2023
698d2bf
不同版本Onnx模型导出适配 (#221)
NaruseMioShirakana Dec 7, 2023
f1a1b4c
fix mismatch when there is space between alpha and non-alpha words (#…
Spycsh Dec 8, 2023
6733e63
Fix multilang generation
OedoSoldier Dec 9, 2023
649b4fb
Update train_ms.py (#225)
EiHeiGanTanHao Dec 10, 2023
9cc786d
[pre-commit.ci] pre-commit autoupdate (#227)
pre-commit-ci[bot] Dec 11, 2023
eaefc57
Use clap to achieve prompt controlled generation (#223)
Stardust-minus Dec 12, 2023
d42fee7
删除无用的Onnx文件 (#230)
NaruseMioShirakana Dec 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ cython_debug/
filelists/*
!/filelists/esd.list
data/*
/config.yml
/*.yml
!/default_config.yml
/Web/
/emotional/*/*.bin
/bert/*/*.bin
Expand All @@ -176,5 +177,9 @@ data/*
/bert/*/*.msgpack
asr_transcript.py
extract_list.py
dataset
/Data
Model
raw/
logs/
Data/*
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
rev: v0.1.7
hooks:
- id: ruff
args: [ --fix ]

- repo: https://github.com/psf/black
rev: 23.10.1
rev: 23.11.0
hooks:
- id: black

Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<div align="center">

<img alt="LOGO" src="https://cdn.jsdelivr.net/gh/fishaudio/fish-diffusion@main/images/logo_512x512.png" width="256" height="256" />

# Bert-VITS2

VITS2 Backbone with bert
VITS2 Backbone with multilingual bert

For quick guide, please refer to `webui_preprocess.py`.

简易教程请参见 `webui_preprocess.py`。

## 请注意,本项目核心思路来源于[anyvoiceai/MassTTS](https://github.com/anyvoiceai/MassTTS) 一个非常好的tts项目
## MassTTS的演示demo为[ai版峰哥锐评峰哥本人,并找回了在金三角失落的腰子](https://www.bilibili.com/video/BV1w24y1c7z9)
Expand All @@ -16,6 +24,7 @@ VITS2 Backbone with bert
### 严禁用于任何政治相关用途。
#### Video:https://www.bilibili.com/video/BV1hp4y1K78E
#### Demo:https://www.bilibili.com/video/BV1TF411k78w
#### QQ Group:815818430
## References
+ [anyvoiceai/MassTTS](https://github.com/anyvoiceai/MassTTS)
+ [jaywalnut310/vits](https://github.com/jaywalnut310/vits)
Expand All @@ -24,6 +33,7 @@ VITS2 Backbone with bert
+ [PaddlePaddle/PaddleSpeech](https://github.com/PaddlePaddle/PaddleSpeech)
+ [emotional-vits](https://github.com/innnky/emotional-vits)
+ [Bert-VITS2-en](https://github.com/xwan07017/Bert-VITS2-en)
+ [Bert-VITS2-UI](https://github.com/jiangyuxiaoxiao/Bert-VITS2-UI)
## 感谢所有贡献者作出的努力
<a href="https://github.com/fishaudio/Bert-VITS2/graphs/contributors" target="_blank">
<img src="https://contrib.rocks/image?repo=fishaudio/Bert-VITS2"/>
Expand Down
14 changes: 14 additions & 0 deletions bert/bert_models.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"deberta-v2-large-japanese-char-wwm": {
"repo_id": "ku-nlp/deberta-v2-large-japanese-char-wwm",
"files": ["pytorch_model.bin"]
},
"chinese-roberta-wwm-ext-large": {
"repo_id": "hfl/chinese-roberta-wwm-ext-large",
"files": ["pytorch_model.bin"]
},
"deberta-v3-large": {
"repo_id": "microsoft/deberta-v3-large",
"files": ["spm.model", "pytorch_model.bin"]
}
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bin.* filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zstandard filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
89 changes: 89 additions & 0 deletions bert/deberta-v2-large-japanese-char-wwm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
language: ja
license: cc-by-sa-4.0
library_name: transformers
tags:
- deberta
- deberta-v2
- fill-mask
- character
- wwm
datasets:
- wikipedia
- cc100
- oscar
metrics:
- accuracy
mask_token: "[MASK]"
widget:
- text: "京都大学で自然言語処理を[MASK][MASK]する。"
---

# Model Card for Japanese character-level DeBERTa V2 large

## Model description

This is a Japanese DeBERTa V2 large model pre-trained on Japanese Wikipedia, the Japanese portion of CC-100, and the Japanese portion of OSCAR.
This model is trained with character-level tokenization and whole word masking.

## How to use

You can use this model for masked language modeling as follows:

```python
from transformers import AutoTokenizer, AutoModelForMaskedLM
tokenizer = AutoTokenizer.from_pretrained('ku-nlp/deberta-v2-large-japanese-char-wwm')
model = AutoModelForMaskedLM.from_pretrained('ku-nlp/deberta-v2-large-japanese-char-wwm')

sentence = '京都大学で自然言語処理を[MASK][MASK]する。'
encoding = tokenizer(sentence, return_tensors='pt')
...
```

You can also fine-tune this model on downstream tasks.

## Tokenization

There is no need to tokenize texts in advance, and you can give raw texts to the tokenizer.
The texts are tokenized into character-level tokens by [sentencepiece](https://github.com/google/sentencepiece).

## Training data

We used the following corpora for pre-training:

- Japanese Wikipedia (as of 20221020, 3.2GB, 27M sentences, 1.3M documents)
- Japanese portion of CC-100 (85GB, 619M sentences, 66M documents)
- Japanese portion of OSCAR (54GB, 326M sentences, 25M documents)

Note that we filtered out documents annotated with "header", "footer", or "noisy" tags in OSCAR.
Also note that Japanese Wikipedia was duplicated 10 times to make the total size of the corpus comparable to that of CC-100 and OSCAR. As a result, the total size of the training data is 171GB.

## Training procedure

We first segmented texts in the corpora into words using [Juman++ 2.0.0-rc3](https://github.com/ku-nlp/jumanpp/releases/tag/v2.0.0-rc3) for whole word masking.
Then, we built a sentencepiece model with 22,012 tokens including all characters that appear in the training corpus.

We tokenized raw corpora into character-level subwords using the sentencepiece model and trained the Japanese DeBERTa model using [transformers](https://github.com/huggingface/transformers) library.
The training took 26 days using 16 NVIDIA A100-SXM4-40GB GPUs.

The following hyperparameters were used during pre-training:

- learning_rate: 1e-4
- per_device_train_batch_size: 26
- distributed_type: multi-GPU
- num_devices: 16
- gradient_accumulation_steps: 8
- total_train_batch_size: 3,328
- max_seq_length: 512
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-06
- lr_scheduler_type: linear schedule with warmup (lr = 0 at 300k steps)
- training_steps: 260,000
- warmup_steps: 10,000

The accuracy of the trained model on the masked language modeling task was 0.795.
The evaluation set consists of 5,000 randomly sampled documents from each of the training corpora.

## Acknowledgments

This work was supported by Joint Usage/Research Center for Interdisciplinary Large-scale Information Infrastructures (JHPCN) through General Collaboration Project no. jh221004, "Developing a Platform for Constructing and Sharing of Large-Scale Japanese Language Models".
For training models, we used the mdx: a platform for the data-driven future.
37 changes: 37 additions & 0 deletions bert/deberta-v2-large-japanese-char-wwm/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"architectures": [
"DebertaV2ForMaskedLM"
],
"attention_head_size": 64,
"attention_probs_dropout_prob": 0.1,
"conv_act": "gelu",
"conv_kernel_size": 3,
"hidden_act": "gelu",
"hidden_dropout_prob": 0.1,
"hidden_size": 1024,
"initializer_range": 0.02,
"intermediate_size": 4096,
"layer_norm_eps": 1e-07,
"max_position_embeddings": 512,
"max_relative_positions": -1,
"model_type": "deberta-v2",
"norm_rel_ebd": "layer_norm",
"num_attention_heads": 16,
"num_hidden_layers": 24,
"pad_token_id": 0,
"pooler_dropout": 0,
"pooler_hidden_act": "gelu",
"pooler_hidden_size": 1024,
"pos_att_type": [
"p2c",
"c2p"
],
"position_biased_input": false,
"position_buckets": 256,
"relative_attention": true,
"share_att_key": true,
"torch_dtype": "float16",
"transformers_version": "4.25.1",
"type_vocab_size": 0,
"vocab_size": 22012
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"cls_token": "[CLS]",
"mask_token": "[MASK]",
"pad_token": "[PAD]",
"sep_token": "[SEP]",
"unk_token": "[UNK]"
}
19 changes: 19 additions & 0 deletions bert/deberta-v2-large-japanese-char-wwm/tokenizer_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"cls_token": "[CLS]",
"do_lower_case": false,
"do_subword_tokenize": true,
"do_word_tokenize": true,
"jumanpp_kwargs": null,
"mask_token": "[MASK]",
"mecab_kwargs": null,
"model_max_length": 1000000000000000019884624838656,
"never_split": null,
"pad_token": "[PAD]",
"sep_token": "[SEP]",
"special_tokens_map_file": null,
"subword_tokenizer_type": "character",
"sudachi_kwargs": null,
"tokenizer_class": "BertJapaneseTokenizer",
"unk_token": "[UNK]",
"word_tokenizer_type": "basic"
}
Loading
Loading