Skip to content

Commit

Permalink
Merge pull request #142 from litagin02/dev
Browse files Browse the repository at this point in the history
v2.6.0
  • Loading branch information
litagin02 authored Jun 16, 2024
2 parents b1970aa + 7e7ac67 commit d281cfe
Show file tree
Hide file tree
Showing 16 changed files with 1,312 additions and 171 deletions.
11 changes: 11 additions & 0 deletions Dataset.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
chcp 65001 > NUL
@echo off

pushd %~dp0
echo Running gradio_tabs/dataset.py...
venv\Scripts\python gradio_tabs/dataset.py

if %errorlevel% neq 0 ( pause & popd & exit /b %errorlevel% )

popd
pause
11 changes: 11 additions & 0 deletions Inference.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
chcp 65001 > NUL
@echo off

pushd %~dp0
echo Running gradio_tabs/inference.py...
venv\Scripts\python gradio_tabs/inference.py

if %errorlevel% neq 0 ( pause & popd & exit /b %errorlevel% )

popd
pause
11 changes: 11 additions & 0 deletions Merge.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
chcp 65001 > NUL
@echo off

pushd %~dp0
echo Running gradio_tabs/merge.py...
venv\Scripts\python gradio_tabs/merge.py

if %errorlevel% neq 0 ( pause & popd & exit /b %errorlevel% )

popd
pause
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ You can install via `pip install style-bert-vits2` (inference only), see [librar
- [Zennの解説記事](https://zenn.dev/litagin/articles/034819a5256ff4)

- [**リリースページ**](https://github.com/litagin02/Style-Bert-VITS2/releases/)[更新履歴](/docs/CHANGELOG.md)
- 2024-06-16: Ver 2.6.0 (モデルの差分マージ・加重マージ・ヌルモデルマージの追加)
- 2024-06-14: Ver 2.5.1 (利用規約をお願いへ変更したのみ)
- 2024-06-02: Ver 2.5.0 (**[利用規約](/docs/TERMS_OF_USE.md)の追加**、フォルダ分けからのスタイル生成、小春音アミ・あみたろモデルの追加、インストールの高速化等)
- 2024-03-16: ver 2.4.1 (**batファイルによるインストール方法の変更**)
Expand Down
11 changes: 11 additions & 0 deletions StyleVectors.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
chcp 65001 > NUL
@echo off

pushd %~dp0
echo Running gradio_tabs/style_vectors.py...
venv\Scripts\python gradio_tabs/style_vectors.py

if %errorlevel% neq 0 ( pause & popd & exit /b %errorlevel% )

popd
pause
11 changes: 11 additions & 0 deletions Train.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
chcp 65001 > NUL
@echo off

pushd %~dp0
echo Running gradio_tabs/train.py...
venv\Scripts\python gradio_tabs/train.py

if %errorlevel% neq 0 ( pause & popd & exit /b %errorlevel% )

popd
pause
2 changes: 1 addition & 1 deletion colab.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"id": "F7aJhsgLAWvO"
},
"source": [
"# Style-Bert-VITS2 (ver 2.5.1) のGoogle Colabでの学習\n",
"# Style-Bert-VITS2 (ver 2.6.0) のGoogle Colabでの学習\n",
"\n",
"Google Colab上でStyle-Bert-VITS2の学習を行うことができます。\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion configs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@
"use_spectral_norm": false,
"gin_channels": 256
},
"version": "2.5.1"
"version": "2.6.0"
}
2 changes: 1 addition & 1 deletion configs/config_jp_extra.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@
"initial_channel": 64
}
},
"version": "2.5.1-JP-Extra"
"version": "2.6.0-JP-Extra"
}
19 changes: 19 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## v2.6.0 (2024-06-16)

### 新機能
モデルのマージ時に、今までの `new = (1 - weight) * A + weight * B` の他に、次を追加
- `new = A + weight * (B - C)`: 差分マージ
- `new = a * A + b * B + c * C`: 加重和マージ
- `new = A + weight * B`: ヌルモデルのマージ
差分マージは、例えばBを「Cと同じ話者だけど囁いているモデル」とすると、`B - C`が囁きベクトル的なものだと思えるので、それをAに足すことで、Aの話者が囁いているような音声を生成できるようになります。

また、加重和で`new = A - B`を作って、それをヌルモデルマージで別のモデルに足せば、実質差分マージを実現できます。また謎に`new = -A``new = 41 * A`等のモデルも作ることができます。

これらのマージの活用法については各自いろいろ考えて実験してみて、面白い使い方があればぜひ共有してください。

囁きについて実験的に作ったヌルモデルを[こちら](https://huggingface.co/litagin/sbv2_null_models)に置いています。これをヌルモデルマージで使うことで、任意のモデルを囁きモデルにある程度は変換できます。

### 改善?

- WebUIの`App.bat`の起動が少し重いので、それぞれの機能を分割した`Dataset.bat`, `Inference.bat`, `Merge.bat`, `StyleVectors.bat`, `Train.bat`を追加 (今までの`App.bat`もこれまで通り使えます)

## v2.5.1 (2024-06-14)

ライセンスとのコンフリクトから、[利用規約](/docs/TERMS_OF_USE.md)[開発陣からのお願いとデフォルトモデルの利用規約](/docs/TERMS_OF_USE.md)に変更しました。
Expand Down
8 changes: 7 additions & 1 deletion gradio_tabs/dataset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import gradio as gr

from style_bert_vits2.constants import GRADIO_THEME
from style_bert_vits2.logging import logger
from style_bert_vits2.utils.subprocess import run_script_with_log

Expand Down Expand Up @@ -109,7 +110,7 @@ def do_transcribe(


def create_dataset_app() -> gr.Blocks:
with gr.Blocks() as app:
with gr.Blocks(theme=GRADIO_THEME) as app:
gr.Markdown(
"**既に1ファイル2-12秒程度の音声ファイル集とその書き起こしデータがある場合は、このタブは使用せずに学習できます。**"
)
Expand Down Expand Up @@ -257,3 +258,8 @@ def create_dataset_app() -> gr.Blocks:
)

return app


if __name__ == "__main__":
app = create_dataset_app()
app.launch(inbrowser=True)
12 changes: 12 additions & 0 deletions gradio_tabs/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,3 +523,15 @@ def tts_fn(
)

return app


if __name__ == "__main__":
from config import get_path_config
import torch

path_config = get_path_config()
assets_root = path_config.assets_root
device = "cuda" if torch.cuda.is_available() else "cpu"
model_holder = TTSModelHolder(assets_root, device)
app = create_inference_app(model_holder)
app.launch(inbrowser=True)
Loading

0 comments on commit d281cfe

Please sign in to comment.