Feat: each tab executables

This commit is contained in:
litagin02
2024-06-16 17:56:32 +09:00
parent 048d0b6c42
commit 7e7ac67906
11 changed files with 104 additions and 3 deletions

View File

@@ -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
@@ -109,7 +110,7 @@ Style-Bert-VITS2の学習用データセットを作成するためのツール
def create_dataset_app() -> gr.Blocks:
with gr.Blocks() as app:
with gr.Blocks(theme=GRADIO_THEME) as app:
gr.Markdown(
"**既に1ファイル2-12秒程度の音声ファイル集とその書き起こしデータがある場合は、このタブは使用せずに学習できます。**"
)
@@ -257,3 +258,8 @@ def create_dataset_app() -> gr.Blocks:
)
return app
if __name__ == "__main__":
app = create_dataset_app()
app.launch(inbrowser=True)

View File

@@ -523,3 +523,15 @@ def create_inference_app(model_holder: TTSModelHolder) -> gr.Blocks:
)
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)

View File

@@ -910,6 +910,8 @@ add_diff_md = """
new_model = A + weight * (B - C)
```
としてマージされます。
通常のマージと違い、**重みを1にしてもAの要素はそのまま保たれます**。
"""
weighted_sum_md = """
@@ -935,7 +937,11 @@ new_model = A + weight * B
```
としてマージされます。
通常のマージと違い、**重みを1にしてもAの要素はそのまま保たれます**。
実際にはヌルモデルでないBに対しても使えますが、その場合はおそらく音声が正常に生成されないモデルができる気がします。が、もしかしたら何かに使えるかもしれません。
囁きについて実験的に作ったヌルモデルを[こちら](https://huggingface.co/litagin/sbv2_null_models)に置いています。これを `B` に使うことで、任意のモデルを囁きモデルにある程度は変換できます。
"""
tts_md = f"""
@@ -1522,4 +1528,4 @@ if __name__ == "__main__":
assets_root, device="cuda" if torch.cuda.is_available() else "cpu"
)
app = create_merge_app(model_holder)
app.launch()
app.launch(inbrowser=True)

View File

@@ -1,3 +1,8 @@
"""
TODO:
importが重いので、WebUI全般が重くなっている。どうにかしたい。
"""
import json
import shutil
from pathlib import Path
@@ -568,3 +573,8 @@ def create_style_vectors_app():
)
return app
if __name__ == "__main__":
app = create_style_vectors_app()
app.launch(inbrowser=True)

View File

@@ -14,6 +14,7 @@ import gradio as gr
import yaml
from config import get_path_config
from style_bert_vits2.constants import GRADIO_THEME
from style_bert_vits2.logging import logger
from style_bert_vits2.utils.stdout_wrapper import SAFE_STDOUT
from style_bert_vits2.utils.subprocess import run_script_with_log, second_elem_of
@@ -484,7 +485,7 @@ english_teacher.wav|Mary|EN|How are you? I'm fine, thank you, and you?
def create_train_app():
with gr.Blocks().queue() as app:
with gr.Blocks(theme=GRADIO_THEME).queue() as app:
gr.Markdown(change_log_md)
with gr.Accordion("使い方", open=False):
gr.Markdown(how_to_md)
@@ -840,3 +841,8 @@ def create_train_app():
)
return app
if __name__ == "__main__":
app = create_train_app()
app.launch(inbrowser=True)