From ccb9b08be3c58e102defcc94ff4fd609da9e27ee Mon Sep 17 00:00:00 2001 From: RVC-Boss <129054828+RVC-Boss@users.noreply.github.com> Date: Thu, 15 Feb 2024 20:16:58 +0800 Subject: [PATCH] =?UTF-8?q?dpo=E6=94=B9=E5=AE=9E=E9=AA=8C=E6=80=A7?= =?UTF-8?q?=E5=8B=BE=E9=80=89=E8=80=8C=E9=9D=9E=E5=BF=85=E9=A1=BB=E3=80=82?= =?UTF-8?q?=E5=8B=BE=E9=80=89=E5=90=8Ebatch=20size=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=87=8F=E5=8D=8A=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dpo改实验性勾选而非必须。勾选后batch size自动减半。 --- webui.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webui.py b/webui.py index fa40c3a..cff7cdb 100644 --- a/webui.py +++ b/webui.py @@ -266,7 +266,7 @@ def close1Ba(): return "已终止SoVITS训练",{"__type__":"update","visible":True},{"__type__":"update","visible":False} p_train_GPT=None -def open1Bb(batch_size,total_epoch,exp_name,if_save_latest,if_save_every_weights,save_every_epoch,gpu_numbers,pretrained_s1): +def open1Bb(batch_size,total_epoch,exp_name,if_dpo,if_save_latest,if_save_every_weights,save_every_epoch,gpu_numbers,pretrained_s1): global p_train_GPT if(p_train_GPT==None): with open("GPT_SoVITS/configs/s1longer.yaml")as f: @@ -283,6 +283,7 @@ def open1Bb(batch_size,total_epoch,exp_name,if_save_latest,if_save_every_weights data["train"]["save_every_n_epoch"]=save_every_epoch data["train"]["if_save_every_weights"]=if_save_every_weights data["train"]["if_save_latest"]=if_save_latest + data["train"]["if_dpo"]=if_dpo data["train"]["half_weights_save_dir"]=GPT_weight_root data["train"]["exp_name"]=exp_name data["train_semantic_path"]="%s/6-name2semantic.tsv"%s1_dir @@ -807,6 +808,7 @@ with gr.Blocks(title="GPT-SoVITS WebUI") as app: with gr.Row(): batch_size1Bb = gr.Slider(minimum=1,maximum=40,step=1,label=i18n("每张显卡的batch_size"),value=default_batch_size,interactive=True) total_epoch1Bb = gr.Slider(minimum=2,maximum=50,step=1,label=i18n("总训练轮数total_epoch"),value=15,interactive=True) + if_dpo = gr.Checkbox(label=i18n("是否开启dpo训练选项(实验性)"), value=False, interactive=True, show_label=True) if_save_latest1Bb = gr.Checkbox(label=i18n("是否仅保存最新的ckpt文件以节省硬盘空间"), value=True, interactive=True, show_label=True) if_save_every_weights1Bb = gr.Checkbox(label=i18n("是否在每次保存时间点将最终小模型保存至weights文件夹"), value=True, interactive=True, show_label=True) save_every_epoch1Bb = gr.Slider(minimum=1,maximum=50,step=1,label=i18n("保存频率save_every_epoch"),value=5,interactive=True) @@ -817,7 +819,7 @@ with gr.Blocks(title="GPT-SoVITS WebUI") as app: info1Bb=gr.Textbox(label=i18n("GPT训练进程输出信息")) button1Ba_open.click(open1Ba, [batch_size,total_epoch,exp_name,text_low_lr_rate,if_save_latest,if_save_every_weights,save_every_epoch,gpu_numbers1Ba,pretrained_s2G,pretrained_s2D], [info1Ba,button1Ba_open,button1Ba_close]) button1Ba_close.click(close1Ba, [], [info1Ba,button1Ba_open,button1Ba_close]) - button1Bb_open.click(open1Bb, [batch_size1Bb,total_epoch1Bb,exp_name,if_save_latest1Bb,if_save_every_weights1Bb,save_every_epoch1Bb,gpu_numbers1Bb,pretrained_s1], [info1Bb,button1Bb_open,button1Bb_close]) + button1Bb_open.click(open1Bb, [batch_size1Bb,total_epoch1Bb,exp_name,if_dpo,if_save_latest1Bb,if_save_every_weights1Bb,save_every_epoch1Bb,gpu_numbers1Bb,pretrained_s1], [info1Bb,button1Bb_open,button1Bb_close]) button1Bb_close.click(close1Bb, [], [info1Bb,button1Bb_open,button1Bb_close]) with gr.TabItem(i18n("1C-推理")): gr.Markdown(value=i18n("选择训练完存放在SoVITS_weights和GPT_weights下的模型。默认的一个是底模,体验5秒Zero Shot TTS用。"))