diff --git a/web.py b/web.py
index 2265e03..bf0fc6a 100644
--- a/web.py
+++ b/web.py
@@ -831,134 +831,133 @@ with gr.Blocks(title="RVC WebUI") as app:
)
modelinfo = gr.Textbox(label=i18n("Model info"), max_lines=8)
with gr.TabItem(i18n("Single inference")):
- with gr.Group():
- with gr.Row():
- with gr.Column():
- vc_transform0 = gr.Number(
- label=i18n(
- "Transpose (integer, number of semitones, raise by an octave: 12, lower by an octave: -12)"
- ),
- value=0,
- )
- input_audio0 = gr.Audio(
- label=i18n("The audio file to be processed"),
- type="filepath",
- )
- file_index2 = gr.Dropdown(
- label=i18n(
- "Auto-detect index path and select from the dropdown"
- ),
- choices=sorted(index_paths),
- interactive=True,
- )
- file_index1 = gr.File(
- label=i18n(
- "Path to the feature index file. Leave blank to use the selected result from the dropdown"
- ),
- )
- with gr.Column():
- f0method0 = gr.Radio(
- label=i18n(
- "Select the pitch extraction algorithm ('pm': faster extraction but lower-quality speech; 'harvest': better bass but extremely slow; 'crepe': better quality but GPU intensive), 'rmvpe': best quality, and little GPU requirement"
- ),
- choices=(
- ["pm", "harvest", "crepe", "rmvpe"]
- if config.dml == False
- else ["pm", "harvest", "rmvpe"]
- ),
- value="rmvpe",
- interactive=True,
- )
- resample_sr0 = gr.Slider(
- minimum=0,
- maximum=48000,
- label=i18n(
- "Resample the output audio in post-processing to the final sample rate. Set to 0 for no resampling"
- ),
- value=0,
- step=1,
- interactive=True,
- )
- rms_mix_rate0 = gr.Slider(
- minimum=0,
- maximum=1,
- label=i18n(
- "Adjust the volume envelope scaling. Closer to 0, the more it mimicks the volume of the original vocals. Can help mask noise and make volume sound more natural when set relatively low. Closer to 1 will be more of a consistently loud volume"
- ),
- value=0.25,
- interactive=True,
- )
- protect0 = gr.Slider(
- minimum=0,
- maximum=0.5,
- label=i18n(
- "Protect voiceless consonants and breath sounds to prevent artifacts such as tearing in electronic music. Set to 0.5 to disable. Decrease the value to increase protection, but it may reduce indexing accuracy"
- ),
- value=0.33,
- step=0.01,
- interactive=True,
- )
- filter_radius0 = gr.Slider(
- minimum=0,
- maximum=7,
- label=i18n(
- "If >=3: apply median filtering to the harvested pitch results. The value represents the filter radius and can reduce breathiness."
- ),
- value=3,
- step=1,
- interactive=True,
- )
- index_rate1 = gr.Slider(
- minimum=0,
- maximum=1,
- label=i18n(
- "Search feature ratio (controls accent strength, too high has artifacting)"
- ),
- value=0.75,
- interactive=True,
- )
- f0_file = gr.File(
- label=i18n(
- "F0 curve file (optional). One pitch per line. Replaces the default F0 and pitch modulation"
- ),
- visible=False,
- )
- but0 = gr.Button(i18n("Convert"), variant="primary")
- vc_output2 = gr.Audio(
- label=i18n(
- "Export audio (click on the three dots in the lower right corner to download)"
- )
+ with gr.Row():
+ with gr.Column():
+ vc_transform0 = gr.Number(
+ label=i18n(
+ "Transpose (integer, number of semitones, raise by an octave: 12, lower by an octave: -12)"
+ ),
+ value=0,
+ )
+ input_audio0 = gr.Audio(
+ label=i18n("The audio file to be processed"),
+ type="filepath",
+ )
+ file_index2 = gr.Dropdown(
+ label=i18n(
+ "Auto-detect index path and select from the dropdown"
+ ),
+ choices=sorted(index_paths),
+ interactive=True,
+ )
+ file_index1 = gr.File(
+ label=i18n(
+ "Path to the feature index file. Leave blank to use the selected result from the dropdown"
+ ),
+ )
+ with gr.Column():
+ f0method0 = gr.Radio(
+ label=i18n(
+ "Select the pitch extraction algorithm ('pm': faster extraction but lower-quality speech; 'harvest': better bass but extremely slow; 'crepe': better quality but GPU intensive), 'rmvpe': best quality, and little GPU requirement"
+ ),
+ choices=(
+ ["pm", "harvest", "crepe", "rmvpe"]
+ if config.dml == False
+ else ["pm", "harvest", "rmvpe"]
+ ),
+ value="rmvpe",
+ interactive=True,
+ )
+ resample_sr0 = gr.Slider(
+ minimum=0,
+ maximum=48000,
+ label=i18n(
+ "Resample the output audio in post-processing to the final sample rate. Set to 0 for no resampling"
+ ),
+ value=0,
+ step=1,
+ interactive=True,
+ )
+ rms_mix_rate0 = gr.Slider(
+ minimum=0,
+ maximum=1,
+ label=i18n(
+ "Adjust the volume envelope scaling. Closer to 0, the more it mimicks the volume of the original vocals. Can help mask noise and make volume sound more natural when set relatively low. Closer to 1 will be more of a consistently loud volume"
+ ),
+ value=0.25,
+ interactive=True,
+ )
+ protect0 = gr.Slider(
+ minimum=0,
+ maximum=0.5,
+ label=i18n(
+ "Protect voiceless consonants and breath sounds to prevent artifacts such as tearing in electronic music. Set to 0.5 to disable. Decrease the value to increase protection, but it may reduce indexing accuracy"
+ ),
+ value=0.33,
+ step=0.01,
+ interactive=True,
+ )
+ filter_radius0 = gr.Slider(
+ minimum=0,
+ maximum=7,
+ label=i18n(
+ "If >=3: apply median filtering to the harvested pitch results. The value represents the filter radius and can reduce breathiness."
+ ),
+ value=3,
+ step=1,
+ interactive=True,
+ )
+ index_rate1 = gr.Slider(
+ minimum=0,
+ maximum=1,
+ label=i18n(
+ "Search feature ratio (controls accent strength, too high has artifacting)"
+ ),
+ value=0.75,
+ interactive=True,
+ )
+ f0_file = gr.File(
+ label=i18n(
+ "F0 curve file (optional). One pitch per line. Replaces the default F0 and pitch modulation"
+ ),
+ visible=False,
+ )
+ but0 = gr.Button(i18n("Convert"), variant="primary")
+ vc_output2 = gr.Audio(
+ label=i18n(
+ "Export audio (click on the three dots in the lower right corner to download)"
)
+ )
- refresh_button.click(
- fn=change_choices,
- inputs=[],
- outputs=[sid0, file_index2],
- api_name="infer_refresh",
- )
- with gr.Group():
- vc_output1 = gr.Textbox(label=i18n("Output information"))
+ refresh_button.click(
+ fn=change_choices,
+ inputs=[],
+ outputs=[sid0, file_index2],
+ api_name="infer_refresh",
+ )
- but0.click(
- vc.vc_single,
- [
- spk_item,
- input_audio0,
- vc_transform0,
- f0_file,
- f0method0,
- file_index1,
- file_index2,
- # file_big_npy1,
- index_rate1,
- filter_radius0,
- resample_sr0,
- rms_mix_rate0,
- protect0,
- ],
- [vc_output1, vc_output2],
- api_name="infer_convert",
- )
+ vc_output1 = gr.Textbox(label=i18n("Output information"))
+
+ but0.click(
+ vc.vc_single,
+ [
+ spk_item,
+ input_audio0,
+ vc_transform0,
+ f0_file,
+ f0method0,
+ file_index1,
+ file_index2,
+ # file_big_npy1,
+ index_rate1,
+ filter_radius0,
+ resample_sr0,
+ rms_mix_rate0,
+ protect0,
+ ],
+ [vc_output1, vc_output2],
+ api_name="infer_convert",
+ )
with gr.TabItem(i18n("Batch inference")):
gr.Markdown(
value=i18n(
@@ -1121,13 +1120,12 @@ with gr.Blocks(title="RVC WebUI") as app:
with gr.TabItem(
i18n("Vocals/Accompaniment Separation & Reverberation Removal")
):
- with gr.Group():
- gr.Markdown(
- value=i18n(
- "Batch processing for vocal accompaniment separation using the UVR5 model.
Example of a valid folder path format: D:\\path\\to\\input\\folder (copy it from the file manager address bar).
The model is divided into three categories:
1. Preserve vocals: Choose this option for audio without harmonies. It preserves vocals better than HP5. It includes two built-in models: HP2 and HP3. HP3 may slightly leak accompaniment but preserves vocals slightly better than HP2.
2. Preserve main vocals only: Choose this option for audio with harmonies. It may weaken the main vocals. It includes one built-in model: HP5.
3. De-reverb and de-delay models (by FoxJoy):
(1) MDX-Net: The best choice for stereo reverb removal but cannot remove mono reverb;
(234) DeEcho: Removes delay effects. Aggressive mode removes more thoroughly than Normal mode. DeReverb additionally removes reverb and can remove mono reverb, but not very effectively for heavily reverberated high-frequency content.
De-reverb/de-delay notes:
1. The processing time for the DeEcho-DeReverb model is approximately twice as long as the other two DeEcho models.
2. The MDX-Net-Dereverb model is quite slow.
3. The recommended cleanest configuration is to apply MDX-Net first and then DeEcho-Aggressive."
- )
+ gr.Markdown(
+ value=i18n(
+ "Batch processing for vocal accompaniment separation using the UVR5 model.
Example of a valid folder path format: D:\\path\\to\\input\\folder (copy it from the file manager address bar).
The model is divided into three categories:
1. Preserve vocals: Choose this option for audio without harmonies. It preserves vocals better than HP5. It includes two built-in models: HP2 and HP3. HP3 may slightly leak accompaniment but preserves vocals slightly better than HP2.
2. Preserve main vocals only: Choose this option for audio with harmonies. It may weaken the main vocals. It includes one built-in model: HP5.
3. De-reverb and de-delay models (by FoxJoy):
(1) MDX-Net: The best choice for stereo reverb removal but cannot remove mono reverb;
(234) DeEcho: Removes delay effects. Aggressive mode removes more thoroughly than Normal mode. DeReverb additionally removes reverb and can remove mono reverb, but not very effectively for heavily reverberated high-frequency content.
De-reverb/de-delay notes:
1. The processing time for the DeEcho-DeReverb model is approximately twice as long as the other two DeEcho models.
2. The MDX-Net-Dereverb model is quite slow.
3. The recommended cleanest configuration is to apply MDX-Net first and then DeEcho-Aggressive."
)
- with gr.Row():
+ )
+ with gr.Row():
with gr.Column():
dir_wav_input = gr.Textbox(
label=i18n(
@@ -1227,450 +1225,446 @@ with gr.Blocks(title="RVC WebUI") as app:
interactive=True,
visible=True,
)
- with gr.Group(): # 暂时单人的, 后面支持最多4人的#数据处理
- gr.Markdown(
- value=i18n(
- "### Step 2. Audio processing. \n#### 1. Slicing.\nAutomatically traverse all files in the training folder that can be decoded into audio and perform slice normalization. Generates 2 wav folders in the experiment directory. Currently, only single-singer/speaker training is supported."
- )
+ gr.Markdown(
+ value=i18n(
+ "### Step 2. Audio processing. \n#### 1. Slicing.\nAutomatically traverse all files in the training folder that can be decoded into audio and perform slice normalization. Generates 2 wav folders in the experiment directory. Currently, only single-singer/speaker training is supported."
)
- with gr.Row():
- with gr.Column():
- trainset_dir4 = gr.Textbox(
- label=i18n("Enter the path of the training folder"),
- )
- spk_id5 = gr.Slider(
- minimum=0,
- maximum=4,
- step=1,
- label=i18n("Please specify the speaker/singer ID"),
- value=0,
- interactive=True,
- )
- but1 = gr.Button(i18n("Process data"), variant="primary")
- with gr.Column():
- info1 = gr.Textbox(label=i18n("Output information"), value="")
- but1.click(
- preprocess_dataset,
- [trainset_dir4, exp_dir1, sr2, np7],
- [info1],
- api_name="train_preprocess",
- )
- with gr.Group():
- gr.Markdown(
- value=i18n(
- "#### 2. Feature extraction.\nUse CPU to extract pitch (if the model has pitch), use GPU to extract features (select GPU index)."
+ )
+ with gr.Row():
+ with gr.Column():
+ trainset_dir4 = gr.Textbox(
+ label=i18n("Enter the path of the training folder"),
)
+ spk_id5 = gr.Slider(
+ minimum=0,
+ maximum=4,
+ step=1,
+ label=i18n("Please specify the speaker/singer ID"),
+ value=0,
+ interactive=True,
+ )
+ but1 = gr.Button(i18n("Process data"), variant="primary")
+ with gr.Column():
+ info1 = gr.Textbox(label=i18n("Output information"), value="")
+ but1.click(
+ preprocess_dataset,
+ [trainset_dir4, exp_dir1, sr2, np7],
+ [info1],
+ api_name="train_preprocess",
+ )
+ gr.Markdown(
+ value=i18n(
+ "#### 2. Feature extraction.\nUse CPU to extract pitch (if the model has pitch), use GPU to extract features (select GPU index)."
)
- with gr.Row():
- with gr.Column():
- gpu_info9 = gr.Textbox(
- label=i18n("GPU Information"),
- value=gpu_info,
- visible=F0GPUVisible,
- )
- gpus6 = gr.Textbox(
- label=i18n(
- "Enter the GPU index(es) separated by '-', e.g., 0-1-2 to use GPU 0, 1, and 2"
- ),
- value=gpus,
- interactive=True,
- visible=F0GPUVisible,
- )
- gpus_rmvpe = gr.Textbox(
- label=i18n(
- "Enter the GPU index(es) separated by '-', e.g., 0-0-1 to use 2 processes in GPU0 and 1 process in GPU1"
- ),
- value="%s-%s" % (gpus, gpus),
- interactive=True,
- visible=F0GPUVisible,
- )
- f0method8 = gr.Radio(
- label=i18n(
- "Select the pitch extraction algorithm: when extracting singing, you can use 'pm' to speed up. For high-quality speech with fast performance, but worse CPU usage, you can use 'dio'. 'harvest' results in better quality but is slower. 'rmvpe' has the best results and consumes less CPU/GPU"
- ),
- choices=["pm", "harvest", "dio", "rmvpe", "rmvpe_gpu"],
- value="rmvpe_gpu",
- interactive=True,
- )
- with gr.Column():
- but2 = gr.Button(i18n("Feature extraction"), variant="primary")
- info2 = gr.Textbox(label=i18n("Output information"), value="")
- f0method8.change(
- fn=change_f0_method,
- inputs=[f0method8],
- outputs=[gpus_rmvpe],
+ )
+ with gr.Row():
+ with gr.Column():
+ gpu_info9 = gr.Textbox(
+ label=i18n("GPU Information"),
+ value=gpu_info,
+ visible=F0GPUVisible,
)
- but2.click(
- extract_f0_feature,
- [
- gpus6,
- np7,
- f0method8,
- if_f0_3,
- exp_dir1,
- version19,
- gpus_rmvpe,
- ],
- [info2],
- api_name="train_extract_f0_feature",
+ gpus6 = gr.Textbox(
+ label=i18n(
+ "Enter the GPU index(es) separated by '-', e.g., 0-1-2 to use GPU 0, 1, and 2"
+ ),
+ value=gpus,
+ interactive=True,
+ visible=F0GPUVisible,
)
- with gr.Group():
- gr.Markdown(
- value=i18n(
- "### Step 3. Start training.\nFill in the training settings and start training the model and index."
+ gpus_rmvpe = gr.Textbox(
+ label=i18n(
+ "Enter the GPU index(es) separated by '-', e.g., 0-0-1 to use 2 processes in GPU0 and 1 process in GPU1"
+ ),
+ value="%s-%s" % (gpus, gpus),
+ interactive=True,
+ visible=F0GPUVisible,
)
+ f0method8 = gr.Radio(
+ label=i18n(
+ "Select the pitch extraction algorithm: when extracting singing, you can use 'pm' to speed up. For high-quality speech with fast performance, but worse CPU usage, you can use 'dio'. 'harvest' results in better quality but is slower. 'rmvpe' has the best results and consumes less CPU/GPU"
+ ),
+ choices=["pm", "harvest", "dio", "rmvpe", "rmvpe_gpu"],
+ value="rmvpe_gpu",
+ interactive=True,
+ )
+ with gr.Column():
+ but2 = gr.Button(i18n("Feature extraction"), variant="primary")
+ info2 = gr.Textbox(label=i18n("Output information"), value="")
+ f0method8.change(
+ fn=change_f0_method,
+ inputs=[f0method8],
+ outputs=[gpus_rmvpe],
)
- with gr.Row():
- with gr.Column():
- save_epoch10 = gr.Slider(
- minimum=1,
- maximum=50,
- step=1,
- label=i18n("Save frequency (save_every_epoch)"),
- value=5,
- interactive=True,
- )
- total_epoch11 = gr.Slider(
- minimum=2,
- maximum=1000,
- step=1,
- label=i18n("Total training epochs (total_epoch)"),
- value=20,
- interactive=True,
- )
- batch_size12 = gr.Slider(
- minimum=1,
- maximum=40,
- step=1,
- label=i18n("Batch size per GPU"),
- value=default_batch_size,
- interactive=True,
- )
- if_save_latest13 = gr.Radio(
- label=i18n(
- "Save only the latest '.ckpt' file to save disk space"
- ),
- choices=[i18n("Yes"), i18n("No")],
- value=i18n("No"),
- interactive=True,
- )
- if_cache_gpu17 = gr.Radio(
- label=i18n(
- "Cache all training sets to GPU memory. Caching small datasets (less than 10 minutes) can speed up training, but caching large datasets will consume a lot of GPU memory and may not provide much speed improvement"
- ),
- choices=[i18n("Yes"), i18n("No")],
- value=i18n("No"),
- interactive=True,
- )
- if_save_every_weights18 = gr.Radio(
- label=i18n(
- "Save a small final model to the 'weights' folder at each save point"
- ),
- choices=[i18n("Yes"), i18n("No")],
- value=i18n("No"),
- interactive=True,
- )
- with gr.Column():
- pretrained_G14 = gr.Textbox(
- label=i18n("Load pre-trained base model G path"),
- value="assets/pretrained_v2/f0G40k.pth",
- interactive=True,
- )
- pretrained_D15 = gr.Textbox(
- label=i18n("Load pre-trained base model D path"),
- value="assets/pretrained_v2/f0D40k.pth",
- interactive=True,
- )
- gpus16 = gr.Textbox(
- label=i18n(
- "Enter the GPU index(es) separated by '-', e.g., 0-1-2 to use GPU 0, 1, and 2"
- ),
- value=gpus,
- interactive=True,
- )
- sr2.change(
- change_sr2,
- [sr2, if_f0_3, version19],
- [pretrained_G14, pretrained_D15],
- )
- version19.change(
- change_version19,
- [sr2, if_f0_3, version19],
- [pretrained_G14, pretrained_D15, sr2],
- )
- if_f0_3.change(
- change_f0,
- [if_f0_3, sr2, version19],
- [f0method8, gpus_rmvpe, pretrained_G14, pretrained_D15],
- )
+ but2.click(
+ extract_f0_feature,
+ [
+ gpus6,
+ np7,
+ f0method8,
+ if_f0_3,
+ exp_dir1,
+ version19,
+ gpus_rmvpe,
+ ],
+ [info2],
+ api_name="train_extract_f0_feature",
+ )
+ gr.Markdown(
+ value=i18n(
+ "### Step 3. Start training.\nFill in the training settings and start training the model and index."
+ )
+ )
+ with gr.Row():
+ with gr.Column():
+ save_epoch10 = gr.Slider(
+ minimum=1,
+ maximum=50,
+ step=1,
+ label=i18n("Save frequency (save_every_epoch)"),
+ value=5,
+ interactive=True,
+ )
+ total_epoch11 = gr.Slider(
+ minimum=2,
+ maximum=1000,
+ step=1,
+ label=i18n("Total training epochs (total_epoch)"),
+ value=20,
+ interactive=True,
+ )
+ batch_size12 = gr.Slider(
+ minimum=1,
+ maximum=40,
+ step=1,
+ label=i18n("Batch size per GPU"),
+ value=default_batch_size,
+ interactive=True,
+ )
+ if_save_latest13 = gr.Radio(
+ label=i18n(
+ "Save only the latest '.ckpt' file to save disk space"
+ ),
+ choices=[i18n("Yes"), i18n("No")],
+ value=i18n("No"),
+ interactive=True,
+ )
+ if_cache_gpu17 = gr.Radio(
+ label=i18n(
+ "Cache all training sets to GPU memory. Caching small datasets (less than 10 minutes) can speed up training, but caching large datasets will consume a lot of GPU memory and may not provide much speed improvement"
+ ),
+ choices=[i18n("Yes"), i18n("No")],
+ value=i18n("No"),
+ interactive=True,
+ )
+ if_save_every_weights18 = gr.Radio(
+ label=i18n(
+ "Save a small final model to the 'weights' folder at each save point"
+ ),
+ choices=[i18n("Yes"), i18n("No")],
+ value=i18n("No"),
+ interactive=True,
+ )
+ with gr.Column():
+ pretrained_G14 = gr.Textbox(
+ label=i18n("Load pre-trained base model G path"),
+ value="assets/pretrained_v2/f0G40k.pth",
+ interactive=True,
+ )
+ pretrained_D15 = gr.Textbox(
+ label=i18n("Load pre-trained base model D path"),
+ value="assets/pretrained_v2/f0D40k.pth",
+ interactive=True,
+ )
+ gpus16 = gr.Textbox(
+ label=i18n(
+ "Enter the GPU index(es) separated by '-', e.g., 0-1-2 to use GPU 0, 1, and 2"
+ ),
+ value=gpus,
+ interactive=True,
+ )
+ sr2.change(
+ change_sr2,
+ [sr2, if_f0_3, version19],
+ [pretrained_G14, pretrained_D15],
+ )
+ version19.change(
+ change_version19,
+ [sr2, if_f0_3, version19],
+ [pretrained_G14, pretrained_D15, sr2],
+ )
+ if_f0_3.change(
+ change_f0,
+ [if_f0_3, sr2, version19],
+ [f0method8, gpus_rmvpe, pretrained_G14, pretrained_D15],
+ )
- but3 = gr.Button(i18n("Train model"), variant="primary")
- but4 = gr.Button(i18n("Train feature index"), variant="primary")
- but5 = gr.Button(i18n("One-click training"), variant="primary")
- with gr.Row():
- info3 = gr.Textbox(label=i18n("Output information"), value="")
- but3.click(
- click_train,
- [
- exp_dir1,
- sr2,
- if_f0_3,
- spk_id5,
- save_epoch10,
- total_epoch11,
- batch_size12,
- if_save_latest13,
- pretrained_G14,
- pretrained_D15,
- gpus16,
- if_cache_gpu17,
- if_save_every_weights18,
- version19,
- author,
- ],
- info3,
- api_name="train_start",
- )
- but4.click(train_index, [exp_dir1, version19], info3)
- but5.click(
- train1key,
- [
- exp_dir1,
- sr2,
- if_f0_3,
- trainset_dir4,
- spk_id5,
- np7,
- f0method8,
- save_epoch10,
- total_epoch11,
- batch_size12,
- if_save_latest13,
- pretrained_G14,
- pretrained_D15,
- gpus16,
- if_cache_gpu17,
- if_save_every_weights18,
- version19,
- gpus_rmvpe,
- author,
- ],
- info3,
- api_name="train_start_all",
- )
+ but3 = gr.Button(i18n("Train model"), variant="primary")
+ but4 = gr.Button(i18n("Train feature index"), variant="primary")
+ but5 = gr.Button(i18n("One-click training"), variant="primary")
+ with gr.Row():
+ info3 = gr.Textbox(label=i18n("Output information"), value="")
+ but3.click(
+ click_train,
+ [
+ exp_dir1,
+ sr2,
+ if_f0_3,
+ spk_id5,
+ save_epoch10,
+ total_epoch11,
+ batch_size12,
+ if_save_latest13,
+ pretrained_G14,
+ pretrained_D15,
+ gpus16,
+ if_cache_gpu17,
+ if_save_every_weights18,
+ version19,
+ author,
+ ],
+ info3,
+ api_name="train_start",
+ )
+ but4.click(train_index, [exp_dir1, version19], info3)
+ but5.click(
+ train1key,
+ [
+ exp_dir1,
+ sr2,
+ if_f0_3,
+ trainset_dir4,
+ spk_id5,
+ np7,
+ f0method8,
+ save_epoch10,
+ total_epoch11,
+ batch_size12,
+ if_save_latest13,
+ pretrained_G14,
+ pretrained_D15,
+ gpus16,
+ if_cache_gpu17,
+ if_save_every_weights18,
+ version19,
+ gpus_rmvpe,
+ author,
+ ],
+ info3,
+ api_name="train_start_all",
+ )
with gr.TabItem(i18n("ckpt Processing")):
- with gr.Group():
- gr.Markdown(
- value=i18n(
- "### Model comparison\n> You can get model ID (long) from `View model information` below.\n\nCalculate a similarity between two models."
+ gr.Markdown(
+ value=i18n(
+ "### Model comparison\n> You can get model ID (long) from `View model information` below.\n\nCalculate a similarity between two models."
+ )
+ )
+ with gr.Row():
+ with gr.Column():
+ id_a = gr.Textbox(label=i18n("ID of model A (long)"), value="")
+ id_b = gr.Textbox(label=i18n("ID of model B (long)"), value="")
+ with gr.Column():
+ butmodelcmp = gr.Button(i18n("Calculate"), variant="primary")
+ infomodelcmp = gr.Textbox(
+ label=i18n("Similarity (from 0 to 1)"),
+ value="",
+ max_lines=1,
)
+ butmodelcmp.click(
+ hash_similarity,
+ [
+ id_a,
+ id_b,
+ ],
+ infomodelcmp,
+ api_name="ckpt_merge",
+ )
+
+ gr.Markdown(
+ value=i18n("### Model fusion\nCan be used to test timbre fusion.")
+ )
+ with gr.Row():
+ with gr.Column():
+ ckpt_a = gr.Textbox(
+ label=i18n("Path to Model A"), value="", interactive=True
+ )
+ ckpt_b = gr.Textbox(
+ label=i18n("Path to Model B"), value="", interactive=True
+ )
+ alpha_a = gr.Slider(
+ minimum=0,
+ maximum=1,
+ label=i18n("Weight (w) for Model A"),
+ value=0.5,
+ interactive=True,
+ )
+ with gr.Column():
+ sr_ = gr.Radio(
+ label=i18n("Target sample rate"),
+ choices=["40k", "48k"],
+ value="40k",
+ interactive=True,
+ )
+ if_f0_ = gr.Radio(
+ label=i18n("Whether the model has pitch guidance"),
+ choices=[i18n("Yes"), i18n("No")],
+ value=i18n("Yes"),
+ interactive=True,
+ )
+ info__ = gr.Textbox(
+ label=i18n("Model information to be placed"),
+ value="",
+ max_lines=8,
+ interactive=True,
+ )
+ with gr.Column():
+ name_to_save0 = gr.Textbox(
+ label=i18n("Saved model name (without extension)"),
+ value="",
+ max_lines=1,
+ interactive=True,
+ )
+ version_2 = gr.Radio(
+ label=i18n("Model architecture version"),
+ choices=["v1", "v2"],
+ value="v1",
+ interactive=True,
+ )
+ but6 = gr.Button(i18n("Fusion"), variant="primary")
+ with gr.Row():
+ info4 = gr.Textbox(label=i18n("Output information"), value="")
+ but6.click(
+ merge,
+ [
+ ckpt_a,
+ ckpt_b,
+ alpha_a,
+ sr_,
+ if_f0_,
+ info__,
+ name_to_save0,
+ version_2,
+ ],
+ info4,
+ api_name="ckpt_merge",
+ ) # def merge(path1,path2,alpha1,sr,f0,info):
+
+ gr.Markdown(
+ value=i18n(
+ "### Modify model information\n> Only supported for small model files extracted from the 'weights' folder."
)
- with gr.Row():
- with gr.Column():
- id_a = gr.Textbox(label=i18n("ID of model A (long)"), value="")
- id_b = gr.Textbox(label=i18n("ID of model B (long)"), value="")
- with gr.Column():
- butmodelcmp = gr.Button(i18n("Calculate"), variant="primary")
- infomodelcmp = gr.Textbox(
- label=i18n("Similarity (from 0 to 1)"),
- value="",
- max_lines=1,
- )
- butmodelcmp.click(
- hash_similarity,
- [
- id_a,
- id_b,
- ],
- infomodelcmp,
- api_name="ckpt_merge",
+ )
+ with gr.Row():
+ with gr.Column():
+ ckpt_path0 = gr.Textbox(
+ label=i18n("Path to Model"), value="", interactive=True
+ )
+ info_ = gr.Textbox(
+ label=i18n("Model information to be modified"),
+ value="",
+ max_lines=8,
+ interactive=True,
+ )
+ name_to_save1 = gr.Textbox(
+ label=i18n(
+ "Save file name (default: same as the source file)"
+ ),
+ value="",
+ max_lines=1,
+ interactive=True,
+ )
+ with gr.Column():
+ but7 = gr.Button(i18n("Modify"), variant="primary")
+ info5 = gr.Textbox(label=i18n("Output information"), value="")
+ but7.click(
+ change_info,
+ [ckpt_path0, info_, name_to_save1],
+ info5,
+ api_name="ckpt_modify",
+ )
+
+ gr.Markdown(
+ value=i18n(
+ "### View model information\n> Only supported for small model files extracted from the 'weights' folder."
)
- with gr.Group():
- gr.Markdown(
- value=i18n("### Model fusion\nCan be used to test timbre fusion.")
+ )
+ with gr.Row():
+ with gr.Column():
+ ckpt_path1 = gr.File(label=i18n("Path to Model"))
+ but8 = gr.Button(i18n("View"), variant="primary")
+ with gr.Column():
+ info6 = gr.Textbox(label=i18n("Output information"), value="")
+ but8.click(show_info, [ckpt_path1], info6, api_name="ckpt_show")
+
+ gr.Markdown(
+ value=i18n(
+ "### Model extraction\n> Enter the path of the large file model under the 'logs' folder.\n\nThis is useful if you want to stop training halfway and manually extract and save a small model file, or if you want to test an intermediate model."
)
- with gr.Row():
- with gr.Column():
- ckpt_a = gr.Textbox(
- label=i18n("Path to Model A"), value="", interactive=True
- )
- ckpt_b = gr.Textbox(
- label=i18n("Path to Model B"), value="", interactive=True
- )
- alpha_a = gr.Slider(
- minimum=0,
- maximum=1,
- label=i18n("Weight (w) for Model A"),
- value=0.5,
- interactive=True,
- )
- with gr.Column():
- sr_ = gr.Radio(
+ )
+ with gr.Row():
+ with gr.Column():
+ ckpt_path2 = gr.Textbox(
+ label=i18n("Path to Model"),
+ value="E:\\codes\\py39\\logs\\mi-test_f0_48k\\G_23333.pth",
+ interactive=True,
+ )
+ save_name = gr.Textbox(
+ label=i18n("Save name"), value="", interactive=True
+ )
+ with gr.Row():
+ sr__ = gr.Radio(
label=i18n("Target sample rate"),
- choices=["40k", "48k"],
+ choices=["32k", "40k", "48k"],
value="40k",
interactive=True,
)
- if_f0_ = gr.Radio(
- label=i18n("Whether the model has pitch guidance"),
- choices=[i18n("Yes"), i18n("No")],
- value=i18n("Yes"),
+ if_f0__ = gr.Radio(
+ label=i18n(
+ "Whether the model has pitch guidance (1: yes, 0: no)"
+ ),
+ choices=["1", "0"],
+ value="1",
interactive=True,
)
- info__ = gr.Textbox(
- label=i18n("Model information to be placed"),
- value="",
- max_lines=8,
- interactive=True,
- )
- with gr.Column():
- name_to_save0 = gr.Textbox(
- label=i18n("Saved model name (without extension)"),
- value="",
- max_lines=1,
- interactive=True,
- )
- version_2 = gr.Radio(
+ version_1 = gr.Radio(
label=i18n("Model architecture version"),
choices=["v1", "v2"],
- value="v1",
+ value="v2",
interactive=True,
)
- but6 = gr.Button(i18n("Fusion"), variant="primary")
- with gr.Row():
- info4 = gr.Textbox(label=i18n("Output information"), value="")
- but6.click(
- merge,
- [
- ckpt_a,
- ckpt_b,
- alpha_a,
- sr_,
- if_f0_,
- info__,
- name_to_save0,
- version_2,
- ],
- info4,
- api_name="ckpt_merge",
- ) # def merge(path1,path2,alpha1,sr,f0,info):
- with gr.Group():
- gr.Markdown(
- value=i18n(
- "### Modify model information\n> Only supported for small model files extracted from the 'weights' folder."
+ info___ = gr.Textbox(
+ label=i18n("Model information to be placed"),
+ value="",
+ max_lines=8,
+ interactive=True,
)
- )
- with gr.Row():
- with gr.Column():
- ckpt_path0 = gr.Textbox(
- label=i18n("Path to Model"), value="", interactive=True
- )
- info_ = gr.Textbox(
- label=i18n("Model information to be modified"),
- value="",
- max_lines=8,
- interactive=True,
- )
- name_to_save1 = gr.Textbox(
- label=i18n(
- "Save file name (default: same as the source file)"
- ),
- value="",
- max_lines=1,
- interactive=True,
- )
- with gr.Column():
- but7 = gr.Button(i18n("Modify"), variant="primary")
- info5 = gr.Textbox(label=i18n("Output information"), value="")
- but7.click(
- change_info,
- [ckpt_path0, info_, name_to_save1],
- info5,
- api_name="ckpt_modify",
- )
- with gr.Group():
- gr.Markdown(
- value=i18n(
- "### View model information\n> Only supported for small model files extracted from the 'weights' folder."
+ extauthor = gr.Textbox(
+ label=i18n("Model Author"),
+ value="",
+ max_lines=1,
+ interactive=True,
)
- )
- with gr.Row():
- with gr.Column():
- ckpt_path1 = gr.File(label=i18n("Path to Model"))
- but8 = gr.Button(i18n("View"), variant="primary")
- with gr.Column():
- info6 = gr.Textbox(label=i18n("Output information"), value="")
- but8.click(show_info, [ckpt_path1], info6, api_name="ckpt_show")
- with gr.Group():
- gr.Markdown(
- value=i18n(
- "### Model extraction\n> Enter the path of the large file model under the 'logs' folder.\n\nThis is useful if you want to stop training halfway and manually extract and save a small model file, or if you want to test an intermediate model."
+ with gr.Column():
+ but9 = gr.Button(i18n("Extract"), variant="primary")
+ info7 = gr.Textbox(label=i18n("Output information"), value="")
+ ckpt_path2.change(
+ change_info_, [ckpt_path2], [sr__, if_f0__, version_1]
)
- )
- with gr.Row():
- with gr.Column():
- ckpt_path2 = gr.Textbox(
- label=i18n("Path to Model"),
- value="E:\\codes\\py39\\logs\\mi-test_f0_48k\\G_23333.pth",
- interactive=True,
- )
- save_name = gr.Textbox(
- label=i18n("Save name"), value="", interactive=True
- )
- with gr.Row():
- sr__ = gr.Radio(
- label=i18n("Target sample rate"),
- choices=["32k", "40k", "48k"],
- value="40k",
- interactive=True,
- )
- if_f0__ = gr.Radio(
- label=i18n(
- "Whether the model has pitch guidance (1: yes, 0: no)"
- ),
- choices=["1", "0"],
- value="1",
- interactive=True,
- )
- version_1 = gr.Radio(
- label=i18n("Model architecture version"),
- choices=["v1", "v2"],
- value="v2",
- interactive=True,
- )
- info___ = gr.Textbox(
- label=i18n("Model information to be placed"),
- value="",
- max_lines=8,
- interactive=True,
- )
- extauthor = gr.Textbox(
- label=i18n("Model Author"),
- value="",
- max_lines=1,
- interactive=True,
- )
- with gr.Column():
- but9 = gr.Button(i18n("Extract"), variant="primary")
- info7 = gr.Textbox(label=i18n("Output information"), value="")
- ckpt_path2.change(
- change_info_, [ckpt_path2], [sr__, if_f0__, version_1]
- )
- but9.click(
- extract_small_model,
- [
- ckpt_path2,
- save_name,
- extauthor,
- sr__,
- if_f0__,
- info___,
- version_1,
- ],
- info7,
- api_name="ckpt_extract",
- )
+ but9.click(
+ extract_small_model,
+ [
+ ckpt_path2,
+ save_name,
+ extauthor,
+ sr__,
+ if_f0__,
+ info___,
+ version_1,
+ ],
+ info7,
+ api_name="ckpt_extract",
+ )
with gr.TabItem(i18n("Export Onnx")):
with gr.Row():