From 4b281493ddc4add0fac16b15d2a4619c8d8253b4 Mon Sep 17 00:00:00 2001 From: DeiantV Date: Sat, 19 Aug 2023 18:24:14 -0500 Subject: [PATCH] Fix Temporally --- easy_infer.py | 6 +- i18n/es_ES.json | 2 +- infer-web.py | 268 ++++++++++++++++++++++++------------------------ 3 files changed, 138 insertions(+), 138 deletions(-) diff --git a/easy_infer.py b/easy_infer.py index 9bb78e5d..343e4be9 100644 --- a/easy_infer.py +++ b/easy_infer.py @@ -486,11 +486,11 @@ def load_downloaded_backup(url): for filename in os.listdir(zips_path): if filename.endswith(".zip"): zipfile_path = os.path.join(zips_path,filename) - # zip_dir_name = os.path.splitext(filename)[0] - # unzip_dir = os.path.join(parent_path,'logs') + zip_dir_name = os.path.splitext(filename)[0] + unzip_dir = os.path.join(parent_path,'logs', zip_dir_name) print(i18n("继续提取...")) infos.append(i18n("继续提取...")) - shutil.unpack_archive(zipfile_path, unzips_path, 'zip') + shutil.unpack_archive(zipfile_path, unzip_dir, 'zip') yield "\n".join(infos) else: print(i18n("解压缩出错。")) diff --git a/i18n/es_ES.json b/i18n/es_ES.json index 6f7e6aea..369fe82f 100644 --- a/i18n/es_ES.json +++ b/i18n/es_ES.json @@ -131,7 +131,7 @@ "训练模型": "Entrenar Modelo", "训练特征索引": "Índice de características del Entrenamiento", "一键训练": "Formación con un solo clic. (No funciona)", - "ckpt处理": "Procesamiento de recibos", + "ckpt处理": "Procesamiento de ckpt", "模型融合, 可用于测试音色融合": "Fusión de modelos, se puede utilizar para fusionar diferentes voces", "A模型路径": "Modelo A ruta.", "B模型路径": "Modelo B ruta.", diff --git a/infer-web.py b/infer-web.py index 5d61b05f..676c5ad2 100644 --- a/infer-web.py +++ b/infer-web.py @@ -2209,140 +2209,140 @@ def toggle_advanced_settings_batch(checkbox): ], [vc_output4], ) - # with gr.TabItem(i18n("ckpt处理")): - # with gr.Group(): - # gr.Markdown(value=i18n("模型融合, 可用于测试音色融合")) - # with gr.Row(): - # ckpt_a = gr.Textbox(label=i18n("A模型路径"), value="", interactive=True, placeholder="Path to your model A.") - # ckpt_b = gr.Textbox(label=i18n("B模型路径"), value="", interactive=True, placeholder="Path to your model B.") - # alpha_a = gr.Slider( - # minimum=0, - # maximum=1, - # label=i18n("A模型权重"), - # value=0.5, - # interactive=True, - # ) - # with gr.Row(): - # sr_ = gr.Radio( - # label=i18n("目标采样率"), - # choices=["40k", "48k"], - # value="40k", - # interactive=True, - # ) - # if_f0_ = gr.Checkbox( - # label=i18n("模型是否具有俯仰引导功能"), - # value=True, - # interactive=True, - # ) - # info__ = gr.Textbox( - # label=i18n("要置入的模型信息"), value="", max_lines=8, interactive=True, placeholder="Model information to be placed." - # ) - # name_to_save0 = gr.Textbox( - # label=i18n("保存的模型名不带后缀"), - # value="", - # placeholder="Name for saving.", - # max_lines=1, - # interactive=True, - # ) - # version_2 = gr.Radio( - # label=i18n("模型版本型号"), - # choices=["v1", "v2"], - # value="v1", - # interactive=True, - # ) - # with gr.Row(): - # but6 = gr.Button(i18n("融合"), variant="primary") - # info4 = gr.Textbox(label=i18n("输出信息"), value="", max_lines=8) - # but6.click( - # merge, - # [ - # ckpt_a, - # ckpt_b, - # alpha_a, - # sr_, - # if_f0_, - # info__, - # name_to_save0, - # version_2, - # ], - # info4, - # ) # def merge(path1,path2,alpha1,sr,f0,info): - # with gr.Group(): - # gr.Markdown(value=i18n("修改模型信息(仅支持weights文件夹下提取的小模型文件)")) - # with gr.Row(): ###### - # ckpt_path0 = gr.Textbox( - # label=i18n("模型路径"), placeholder="Path to your Model.", value="", interactive=True - # ) - # info_ = gr.Textbox( - # label=i18n("要改的模型信息"), value="", max_lines=8, interactive=True, placeholder="Model information to be changed." - # ) - # name_to_save1 = gr.Textbox( - # label=i18n("保存的文件名, 默认空为和源文件同名"), - # placeholder="Either leave empty or put in the Name of the Model to be saved.", - # value="", - # max_lines=8, - # interactive=True, - # ) - # with gr.Row(): - # but7 = gr.Button(i18n("修改"), variant="primary") - # info5 = gr.Textbox(label=i18n("输出信息"), value="", max_lines=8) - # but7.click(change_info, [ckpt_path0, info_, name_to_save1], info5) - # with gr.Group(): - # gr.Markdown(value=i18n("查看模型信息(仅支持weights文件夹下提取的小模型文件)")) - # with gr.Row(): - # ckpt_path1 = gr.Textbox( - # label=i18n("模型路径"), value="", interactive=True, placeholder="Model path here." - # ) - # but8 = gr.Button(i18n("查看"), variant="primary") - # info6 = gr.Textbox(label=i18n("输出信息"), value="", max_lines=8) - # but8.click(show_info, [ckpt_path1], info6) - # with gr.Group(): - # gr.Markdown( - # value=i18n( - # "模型提取(输入logs文件夹下大文件模型路径),适用于训一半不想训了模型没有自动提取保存小文件模型,或者想测试中间模型的情况" - # ) - # ) - # with gr.Row(): - # ckpt_path2 = gr.Textbox( - # lines=3, - # label=i18n("模型路径"), - # value=os.path.join(now_dir, "logs", "[YOUR_MODEL]", "G_23333.pth"), - # interactive=True, - # ) - # save_name = gr.Textbox( - # label=i18n("保存名"), value="", interactive=True, - # placeholder="Your filename here.", - # ) - # sr__ = gr.Radio( - # label=i18n("目标采样率"), - # choices=["32k", "40k", "48k"], - # value="40k", - # interactive=True, - # ) - # if_f0__ = gr.Checkbox( - # label=i18n("模型是否具有俯仰引导功能"), - # value=True, - # interactive=True, - # ) - # version_1 = gr.Radio( - # label=i18n("模型版本型号"), - # choices=["v1", "v2"], - # value="v2", - # interactive=True, - # ) - # info___ = gr.Textbox( - # label=i18n("要置入的模型信息"), value="", max_lines=8, interactive=True, placeholder="Model info here." - # ) - # but9 = gr.Button(i18n("提取"), variant="primary") - # info7 = gr.Textbox(label=i18n("输出信息"), value="", max_lines=8) - # ckpt_path2.change( - # change_info_, [ckpt_path2], [sr__, if_f0__, version_1] - # ) - # but9.click( - # extract_small_model, - # [ckpt_path2, save_name, sr__, if_f0__, info___, version_1], - # info7, - # ) + with gr.TabItem(i18n("ckpt处理")): + with gr.Group(): + gr.Markdown(value=i18n("模型融合, 可用于测试音色融合")) + with gr.Row(): + ckpt_a = gr.Textbox(label=i18n("A模型路径"), value="", interactive=True, placeholder="Path to your model A.") + ckpt_b = gr.Textbox(label=i18n("B模型路径"), value="", interactive=True, placeholder="Path to your model B.") + alpha_a = gr.Slider( + minimum=0, + maximum=1, + label=i18n("A模型权重"), + value=0.5, + interactive=True, + ) + with gr.Row(): + sr_ = gr.Radio( + label=i18n("目标采样率"), + choices=["40k", "48k"], + value="40k", + interactive=True, + ) + if_f0_ = gr.Checkbox( + label="Whether the model has pitch guidance.", + value=True, + interactive=True, + ) + info__ = gr.Textbox( + label=i18n("要置入的模型信息"), value="", max_lines=8, interactive=True, placeholder="Model information to be placed." + ) + name_to_save0 = gr.Textbox( + label=i18n("保存的模型名不带后缀"), + value="", + placeholder="Name for saving.", + max_lines=1, + interactive=True, + ) + version_2 = gr.Radio( + label=i18n("模型版本型号"), + choices=["v1", "v2"], + value="v1", + interactive=True, + ) + with gr.Row(): + but6 = gr.Button(i18n("融合"), variant="primary") + info4 = gr.Textbox(label=i18n("输出信息"), value="", max_lines=8) + but6.click( + merge, + [ + ckpt_a, + ckpt_b, + alpha_a, + sr_, + if_f0_, + info__, + name_to_save0, + version_2, + ], + info4, + ) # def merge(path1,path2,alpha1,sr,f0,info): + with gr.Group(): + gr.Markdown(value=i18n("修改模型信息(仅支持weights文件夹下提取的小模型文件)")) + with gr.Row(): ###### + ckpt_path0 = gr.Textbox( + label=i18n("模型路径"), placeholder="Path to your Model.", value="", interactive=True + ) + info_ = gr.Textbox( + label=i18n("要改的模型信息"), value="", max_lines=8, interactive=True, placeholder="Model information to be changed." + ) + name_to_save1 = gr.Textbox( + label=i18n("保存的文件名, 默认空为和源文件同名"), + placeholder="Either leave empty or put in the Name of the Model to be saved.", + value="", + max_lines=8, + interactive=True, + ) + with gr.Row(): + but7 = gr.Button(i18n("修改"), variant="primary") + info5 = gr.Textbox(label=i18n("输出信息"), value="", max_lines=8) + but7.click(change_info, [ckpt_path0, info_, name_to_save1], info5) + with gr.Group(): + gr.Markdown(value=i18n("查看模型信息(仅支持weights文件夹下提取的小模型文件)")) + with gr.Row(): + ckpt_path1 = gr.Textbox( + label=i18n("模型路径"), value="", interactive=True, placeholder="Model path here." + ) + but8 = gr.Button(i18n("查看"), variant="primary") + info6 = gr.Textbox(label=i18n("输出信息"), value="", max_lines=8) + but8.click(show_info, [ckpt_path1], info6) + with gr.Group(): + gr.Markdown( + value=i18n( + "模型提取(输入logs文件夹下大文件模型路径),适用于训一半不想训了模型没有自动提取保存小文件模型,或者想测试中间模型的情况" + ) + ) + with gr.Row(): + ckpt_path2 = gr.Textbox( + lines=3, + label=i18n("模型路径"), + value=os.path.join(now_dir, "logs", "[YOUR_MODEL]", "G_23333.pth"), + interactive=True, + ) + save_name = gr.Textbox( + label=i18n("保存名"), value="", interactive=True, + placeholder="Your filename here.", + ) + sr__ = gr.Radio( + label=i18n("目标采样率"), + choices=["32k", "40k", "48k"], + value="40k", + interactive=True, + ) + if_f0__ = gr.Checkbox( + label="Whether the model has pitch guidance.", + value=True, + interactive=True, + ) + version_1 = gr.Radio( + label=i18n("模型版本型号"), + choices=["v1", "v2"], + value="v2", + interactive=True, + ) + info___ = gr.Textbox( + label=i18n("要置入的模型信息"), value="", max_lines=8, interactive=True, placeholder="Model info here." + ) + but9 = gr.Button(i18n("提取"), variant="primary") + info7 = gr.Textbox(label=i18n("输出信息"), value="", max_lines=8) + ckpt_path2.change( + change_info_, [ckpt_path2], [sr__, if_f0__, version_1] + ) + but9.click( + extract_small_model, + [ckpt_path2, save_name, sr__, if_f0__, info___, version_1], + info7, + ) # with gr.TabItem(i18n("Onnx导出")): # with gr.Row():