- main/app/app.py +0 -1
- main/app/tabs/downloads/downloads.py +2 -2
- main/app/tabs/editing/child/audio_effects.py +10 -10
- main/app/tabs/editing/child/quirk.py +2 -2
- main/app/tabs/extra/child/create_srt.py +1 -1
- main/app/tabs/extra/child/f0_extract.py +2 -2
- main/app/tabs/extra/child/settings.py +3 -3
- main/app/tabs/inference/child/convert.py +662 -164
- main/app/tabs/inference/child/convert_tts.py +9 -9
- main/app/tabs/inference/child/convert_with_whisper.py +5 -5
- main/app/tabs/inference/child/separate.py +407 -138
- main/app/tabs/training/child/create_reference.py +4 -4
- main/app/tabs/training/child/training.py +7 -7
main/app/app.py
CHANGED
|
@@ -469,7 +469,6 @@ with gr.Blocks(
|
|
| 469 |
if __name__ == "__main__":
|
| 470 |
logger.info(config.device.replace("privateuseone", "dml"))
|
| 471 |
logger.info(translations["start_app"])
|
| 472 |
-
logger.info(translations["set_lang"].format(lang=en - US))
|
| 473 |
|
| 474 |
port = configs.get("app_port", 7860)
|
| 475 |
server_name = configs.get("server_name", "0.0.0.0")
|
|
|
|
| 469 |
if __name__ == "__main__":
|
| 470 |
logger.info(config.device.replace("privateuseone", "dml"))
|
| 471 |
logger.info(translations["start_app"])
|
|
|
|
| 472 |
|
| 473 |
port = configs.get("app_port", 7860)
|
| 474 |
server_name = configs.get("server_name", "0.0.0.0")
|
main/app/tabs/downloads/downloads.py
CHANGED
|
@@ -37,7 +37,7 @@ def download_tab():
|
|
| 37 |
with gr.Column():
|
| 38 |
model_upload = gr.Files(label=translations["drop_model"], file_types=[".pth", ".onnx", ".index", ".zip"], visible=False)
|
| 39 |
with gr.Row():
|
| 40 |
-
with gr.Accordion(translations["download_pretrained_2"], open=
|
| 41 |
with gr.Row():
|
| 42 |
pretrain_download_choices = gr.Radio(label=translations["model_download_select"], choices=[translations["download_url"], translations["list_model"], translations["upload"]], value=translations["download_url"], interactive=True)
|
| 43 |
with gr.Row():
|
|
@@ -109,4 +109,4 @@ def download_tab():
|
|
| 109 |
inputs=[pretrain_upload],
|
| 110 |
outputs=[],
|
| 111 |
api_name="upload_pretrain"
|
| 112 |
-
)
|
|
|
|
| 37 |
with gr.Column():
|
| 38 |
model_upload = gr.Files(label=translations["drop_model"], file_types=[".pth", ".onnx", ".index", ".zip"], visible=False)
|
| 39 |
with gr.Row():
|
| 40 |
+
with gr.Accordion(translations["download_pretrained_2"], open=True):
|
| 41 |
with gr.Row():
|
| 42 |
pretrain_download_choices = gr.Radio(label=translations["model_download_select"], choices=[translations["download_url"], translations["list_model"], translations["upload"]], value=translations["download_url"], interactive=True)
|
| 43 |
with gr.Row():
|
|
|
|
| 109 |
inputs=[pretrain_upload],
|
| 110 |
outputs=[],
|
| 111 |
api_name="upload_pretrain"
|
| 112 |
+
)
|
main/app/tabs/editing/child/audio_effects.py
CHANGED
|
@@ -23,7 +23,7 @@ def audio_effects_tab():
|
|
| 23 |
compressor_check_box = gr.Checkbox(label=translations["compressor"], value=False, interactive=True)
|
| 24 |
more_options = gr.Checkbox(label=translations["more_option"], value=False, interactive=True)
|
| 25 |
with gr.Row():
|
| 26 |
-
with gr.Accordion(translations["input_output"], open=
|
| 27 |
with gr.Row():
|
| 28 |
upload_audio = gr.Files(label=translations["drop_audio"], file_types=file_types)
|
| 29 |
with gr.Row():
|
|
@@ -41,13 +41,13 @@ def audio_effects_tab():
|
|
| 41 |
with gr.Row():
|
| 42 |
audio_output_format = gr.Radio(label=translations["export_format"], info=translations["export_info"], choices=export_format_choices, value="wav", interactive=True)
|
| 43 |
with gr.Row():
|
| 44 |
-
with gr.Accordion(translations["use_presets"], open=
|
| 45 |
with gr.Row():
|
| 46 |
presets_name = gr.Dropdown(label=translations["file_preset"], choices=audio_effect_presets_file, value=audio_effect_presets_file[0] if len(audio_effect_presets_file) > 0 else '', interactive=True, allow_custom_value=True)
|
| 47 |
with gr.Row():
|
| 48 |
load_click = gr.Button(translations["load_file"], variant="primary")
|
| 49 |
refresh_click = gr.Button(translations["refresh"])
|
| 50 |
-
with gr.Accordion(translations["export_file"], open=
|
| 51 |
with gr.Row():
|
| 52 |
with gr.Column():
|
| 53 |
name_to_save_file = gr.Textbox(label=translations["filename_to_save"])
|
|
@@ -59,7 +59,7 @@ def audio_effects_tab():
|
|
| 59 |
with gr.Row():
|
| 60 |
with gr.Column():
|
| 61 |
with gr.Row():
|
| 62 |
-
with gr.Accordion(translations["reverb"], open=
|
| 63 |
reverb_freeze_mode = gr.Checkbox(label=translations["reverb_freeze"], info=translations["reverb_freeze_info"], value=False, interactive=True)
|
| 64 |
reverb_room_size = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.15, label=translations["room_size"], info=translations["room_size_info"], interactive=True)
|
| 65 |
reverb_damping = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.7, label=translations["damping"], info=translations["damping_info"], interactive=True)
|
|
@@ -67,20 +67,20 @@ def audio_effects_tab():
|
|
| 67 |
reverb_dry_level = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.8, label=translations["dry_level"], info=translations["dry_level_info"], interactive=True)
|
| 68 |
reverb_width = gr.Slider(minimum=0, maximum=1, step=0.01, value=1, label=translations["width"], info=translations["width_info"], interactive=True)
|
| 69 |
with gr.Row():
|
| 70 |
-
with gr.Accordion(translations["chorus"], open=
|
| 71 |
chorus_depth = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.5, label=translations["chorus_depth"], info=translations["chorus_depth_info"], interactive=True)
|
| 72 |
chorus_rate_hz = gr.Slider(minimum=0.1, maximum=10, step=0.1, value=1.5, label=translations["chorus_rate_hz"], info=translations["chorus_rate_hz_info"], interactive=True)
|
| 73 |
chorus_mix = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.5, label=translations["chorus_mix"], info=translations["chorus_mix_info"], interactive=True)
|
| 74 |
chorus_centre_delay_ms = gr.Slider(minimum=0, maximum=50, step=1, value=10, label=translations["chorus_centre_delay_ms"], info=translations["chorus_centre_delay_ms_info"], interactive=True)
|
| 75 |
chorus_feedback = gr.Slider(minimum=-1, maximum=1, step=0.01, value=0, label=translations["chorus_feedback"], info=translations["chorus_feedback_info"], interactive=True)
|
| 76 |
with gr.Row():
|
| 77 |
-
with gr.Accordion(translations["delay"], open=
|
| 78 |
delay_second = gr.Slider(minimum=0, maximum=5, step=0.01, value=0.5, label=translations["delay_seconds"], info=translations["delay_seconds_info"], interactive=True)
|
| 79 |
delay_feedback = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.5, label=translations["delay_feedback"], info=translations["delay_feedback_info"], interactive=True)
|
| 80 |
delay_mix = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.5, label=translations["delay_mix"], info=translations["delay_mix_info"], interactive=True)
|
| 81 |
with gr.Column():
|
| 82 |
with gr.Row():
|
| 83 |
-
with gr.Accordion(translations["more_option"], open=
|
| 84 |
with gr.Row():
|
| 85 |
fade = gr.Checkbox(label=translations["fade"], value=False, interactive=True)
|
| 86 |
bass_or_treble = gr.Checkbox(label=translations["bass_or_treble"], value=False, interactive=True)
|
|
@@ -114,14 +114,14 @@ def audio_effects_tab():
|
|
| 114 |
clipping_threshold_db = gr.Slider(minimum=-60, maximum=0, step=1, value=-1, label=translations["clipping_threshold_db"], info=translations["clipping_threshold_db_info"], interactive=True, visible=clipping_checkbox.value)
|
| 115 |
bitcrush_bit_depth = gr.Slider(minimum=1, maximum=24, step=1, value=16, label=translations["bitcrush_bit_depth"], info=translations["bitcrush_bit_depth_info"], interactive=True, visible=bitcrush_checkbox.value)
|
| 116 |
with gr.Row():
|
| 117 |
-
with gr.Accordion(translations["phaser"], open=
|
| 118 |
phaser_depth = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.5, label=translations["phaser_depth"], info=translations["phaser_depth_info"], interactive=True)
|
| 119 |
phaser_rate_hz = gr.Slider(minimum=0.1, maximum=10, step=0.1, value=1, label=translations["phaser_rate_hz"], info=translations["phaser_rate_hz_info"], interactive=True)
|
| 120 |
phaser_mix = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.5, label=translations["phaser_mix"], info=translations["phaser_mix_info"], interactive=True)
|
| 121 |
phaser_centre_frequency_hz = gr.Slider(minimum=50, maximum=5000, step=10, value=1000, label=translations["phaser_centre_frequency_hz"], info=translations["phaser_centre_frequency_hz_info"], interactive=True)
|
| 122 |
phaser_feedback = gr.Slider(minimum=-1, maximum=1, step=0.01, value=0, label=translations["phaser_feedback"], info=translations["phaser_feedback_info"], interactive=True)
|
| 123 |
with gr.Row():
|
| 124 |
-
with gr.Accordion(translations["compressor"], open=
|
| 125 |
compressor_threshold_db = gr.Slider(minimum=-60, maximum=0, step=1, value=-20, label=translations["compressor_threshold_db"], info=translations["compressor_threshold_db_info"], interactive=True)
|
| 126 |
compressor_ratio = gr.Slider(minimum=1, maximum=20, step=0.1, value=1, label=translations["compressor_ratio"], info=translations["compressor_ratio_info"], interactive=True)
|
| 127 |
compressor_attack_ms = gr.Slider(minimum=0.1, maximum=100, step=0.1, value=10, label=translations["compressor_attack_ms"], info=translations["compressor_attack_ms_info"], interactive=True)
|
|
@@ -390,4 +390,4 @@ def audio_effects_tab():
|
|
| 390 |
],
|
| 391 |
outputs=[audio_play_output],
|
| 392 |
api_name="audio_effects"
|
| 393 |
-
)
|
|
|
|
| 23 |
compressor_check_box = gr.Checkbox(label=translations["compressor"], value=False, interactive=True)
|
| 24 |
more_options = gr.Checkbox(label=translations["more_option"], value=False, interactive=True)
|
| 25 |
with gr.Row():
|
| 26 |
+
with gr.Accordion(translations["input_output"], open=True):
|
| 27 |
with gr.Row():
|
| 28 |
upload_audio = gr.Files(label=translations["drop_audio"], file_types=file_types)
|
| 29 |
with gr.Row():
|
|
|
|
| 41 |
with gr.Row():
|
| 42 |
audio_output_format = gr.Radio(label=translations["export_format"], info=translations["export_info"], choices=export_format_choices, value="wav", interactive=True)
|
| 43 |
with gr.Row():
|
| 44 |
+
with gr.Accordion(translations["use_presets"], open=True):
|
| 45 |
with gr.Row():
|
| 46 |
presets_name = gr.Dropdown(label=translations["file_preset"], choices=audio_effect_presets_file, value=audio_effect_presets_file[0] if len(audio_effect_presets_file) > 0 else '', interactive=True, allow_custom_value=True)
|
| 47 |
with gr.Row():
|
| 48 |
load_click = gr.Button(translations["load_file"], variant="primary")
|
| 49 |
refresh_click = gr.Button(translations["refresh"])
|
| 50 |
+
with gr.Accordion(translations["export_file"], open=True):
|
| 51 |
with gr.Row():
|
| 52 |
with gr.Column():
|
| 53 |
name_to_save_file = gr.Textbox(label=translations["filename_to_save"])
|
|
|
|
| 59 |
with gr.Row():
|
| 60 |
with gr.Column():
|
| 61 |
with gr.Row():
|
| 62 |
+
with gr.Accordion(translations["reverb"], open=True, visible=reverb_check_box.value) as reverb_accordion:
|
| 63 |
reverb_freeze_mode = gr.Checkbox(label=translations["reverb_freeze"], info=translations["reverb_freeze_info"], value=False, interactive=True)
|
| 64 |
reverb_room_size = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.15, label=translations["room_size"], info=translations["room_size_info"], interactive=True)
|
| 65 |
reverb_damping = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.7, label=translations["damping"], info=translations["damping_info"], interactive=True)
|
|
|
|
| 67 |
reverb_dry_level = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.8, label=translations["dry_level"], info=translations["dry_level_info"], interactive=True)
|
| 68 |
reverb_width = gr.Slider(minimum=0, maximum=1, step=0.01, value=1, label=translations["width"], info=translations["width_info"], interactive=True)
|
| 69 |
with gr.Row():
|
| 70 |
+
with gr.Accordion(translations["chorus"], open=True, visible=chorus_check_box.value) as chorus_accordion:
|
| 71 |
chorus_depth = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.5, label=translations["chorus_depth"], info=translations["chorus_depth_info"], interactive=True)
|
| 72 |
chorus_rate_hz = gr.Slider(minimum=0.1, maximum=10, step=0.1, value=1.5, label=translations["chorus_rate_hz"], info=translations["chorus_rate_hz_info"], interactive=True)
|
| 73 |
chorus_mix = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.5, label=translations["chorus_mix"], info=translations["chorus_mix_info"], interactive=True)
|
| 74 |
chorus_centre_delay_ms = gr.Slider(minimum=0, maximum=50, step=1, value=10, label=translations["chorus_centre_delay_ms"], info=translations["chorus_centre_delay_ms_info"], interactive=True)
|
| 75 |
chorus_feedback = gr.Slider(minimum=-1, maximum=1, step=0.01, value=0, label=translations["chorus_feedback"], info=translations["chorus_feedback_info"], interactive=True)
|
| 76 |
with gr.Row():
|
| 77 |
+
with gr.Accordion(translations["delay"], open=True, visible=delay_check_box.value) as delay_accordion:
|
| 78 |
delay_second = gr.Slider(minimum=0, maximum=5, step=0.01, value=0.5, label=translations["delay_seconds"], info=translations["delay_seconds_info"], interactive=True)
|
| 79 |
delay_feedback = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.5, label=translations["delay_feedback"], info=translations["delay_feedback_info"], interactive=True)
|
| 80 |
delay_mix = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.5, label=translations["delay_mix"], info=translations["delay_mix_info"], interactive=True)
|
| 81 |
with gr.Column():
|
| 82 |
with gr.Row():
|
| 83 |
+
with gr.Accordion(translations["more_option"], open=True, visible=more_options.value) as more_accordion:
|
| 84 |
with gr.Row():
|
| 85 |
fade = gr.Checkbox(label=translations["fade"], value=False, interactive=True)
|
| 86 |
bass_or_treble = gr.Checkbox(label=translations["bass_or_treble"], value=False, interactive=True)
|
|
|
|
| 114 |
clipping_threshold_db = gr.Slider(minimum=-60, maximum=0, step=1, value=-1, label=translations["clipping_threshold_db"], info=translations["clipping_threshold_db_info"], interactive=True, visible=clipping_checkbox.value)
|
| 115 |
bitcrush_bit_depth = gr.Slider(minimum=1, maximum=24, step=1, value=16, label=translations["bitcrush_bit_depth"], info=translations["bitcrush_bit_depth_info"], interactive=True, visible=bitcrush_checkbox.value)
|
| 116 |
with gr.Row():
|
| 117 |
+
with gr.Accordion(translations["phaser"], open=True, visible=phaser_check_box.value) as phaser_accordion:
|
| 118 |
phaser_depth = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.5, label=translations["phaser_depth"], info=translations["phaser_depth_info"], interactive=True)
|
| 119 |
phaser_rate_hz = gr.Slider(minimum=0.1, maximum=10, step=0.1, value=1, label=translations["phaser_rate_hz"], info=translations["phaser_rate_hz_info"], interactive=True)
|
| 120 |
phaser_mix = gr.Slider(minimum=0, maximum=1, step=0.01, value=0.5, label=translations["phaser_mix"], info=translations["phaser_mix_info"], interactive=True)
|
| 121 |
phaser_centre_frequency_hz = gr.Slider(minimum=50, maximum=5000, step=10, value=1000, label=translations["phaser_centre_frequency_hz"], info=translations["phaser_centre_frequency_hz_info"], interactive=True)
|
| 122 |
phaser_feedback = gr.Slider(minimum=-1, maximum=1, step=0.01, value=0, label=translations["phaser_feedback"], info=translations["phaser_feedback_info"], interactive=True)
|
| 123 |
with gr.Row():
|
| 124 |
+
with gr.Accordion(translations["compressor"], open=True, visible=compressor_check_box.value) as compressor_accordion:
|
| 125 |
compressor_threshold_db = gr.Slider(minimum=-60, maximum=0, step=1, value=-20, label=translations["compressor_threshold_db"], info=translations["compressor_threshold_db_info"], interactive=True)
|
| 126 |
compressor_ratio = gr.Slider(minimum=1, maximum=20, step=0.1, value=1, label=translations["compressor_ratio"], info=translations["compressor_ratio_info"], interactive=True)
|
| 127 |
compressor_attack_ms = gr.Slider(minimum=0.1, maximum=100, step=0.1, value=10, label=translations["compressor_attack_ms"], info=translations["compressor_attack_ms_info"], interactive=True)
|
|
|
|
| 390 |
],
|
| 391 |
outputs=[audio_play_output],
|
| 392 |
api_name="audio_effects"
|
| 393 |
+
)
|
main/app/tabs/editing/child/quirk.py
CHANGED
|
@@ -19,7 +19,7 @@ def quirk_tab():
|
|
| 19 |
with gr.Row():
|
| 20 |
apply_quirk_button = gr.Button(translations["apply"], variant="primary")
|
| 21 |
with gr.Row():
|
| 22 |
-
with gr.Accordion(translations["input_output"], open=
|
| 23 |
with gr.Row():
|
| 24 |
quirk_upload_audio = gr.Files(label=translations["drop_audio"], file_types=file_types)
|
| 25 |
with gr.Column():
|
|
@@ -45,4 +45,4 @@ def quirk_tab():
|
|
| 45 |
],
|
| 46 |
outputs=[output_audio_play],
|
| 47 |
api_name="quirk"
|
| 48 |
-
)
|
|
|
|
| 19 |
with gr.Row():
|
| 20 |
apply_quirk_button = gr.Button(translations["apply"], variant="primary")
|
| 21 |
with gr.Row():
|
| 22 |
+
with gr.Accordion(translations["input_output"], open=True):
|
| 23 |
with gr.Row():
|
| 24 |
quirk_upload_audio = gr.Files(label=translations["drop_audio"], file_types=file_types)
|
| 25 |
with gr.Column():
|
|
|
|
| 45 |
],
|
| 46 |
outputs=[output_audio_play],
|
| 47 |
api_name="quirk"
|
| 48 |
+
)
|
main/app/tabs/extra/child/create_srt.py
CHANGED
|
@@ -21,7 +21,7 @@ def create_srt_tab():
|
|
| 21 |
with gr.Row():
|
| 22 |
convert_button = gr.Button(translations["convert_audio"], variant="primary")
|
| 23 |
with gr.Row():
|
| 24 |
-
with gr.Accordion(translations["input_output"], open=
|
| 25 |
with gr.Column():
|
| 26 |
input_audio = gr.Dropdown(label=translations["audio_path"], value="", choices=paths_for_files, info=translations["provide_audio"], allow_custom_value=True, interactive=True)
|
| 27 |
output_file = gr.Textbox(label=translations["srt_output_file"], value="srt/output.srt", placeholder="srt/output.srt", interactive=True)
|
|
|
|
| 21 |
with gr.Row():
|
| 22 |
convert_button = gr.Button(translations["convert_audio"], variant="primary")
|
| 23 |
with gr.Row():
|
| 24 |
+
with gr.Accordion(translations["input_output"], open=True):
|
| 25 |
with gr.Column():
|
| 26 |
input_audio = gr.Dropdown(label=translations["audio_path"], value="", choices=paths_for_files, info=translations["provide_audio"], allow_custom_value=True, interactive=True)
|
| 27 |
output_file = gr.Textbox(label=translations["srt_output_file"], value="srt/output.srt", placeholder="srt/output.srt", interactive=True)
|
main/app/tabs/extra/child/f0_extract.py
CHANGED
|
@@ -19,7 +19,7 @@ def f0_extract_tab():
|
|
| 19 |
upload_audio_file = gr.Files(label=translations["drop_audio"], file_types=file_types)
|
| 20 |
audioplay = gr.Audio(show_download_button=True, interactive=False, label=translations["input_audio"])
|
| 21 |
with gr.Column():
|
| 22 |
-
with gr.Accordion(translations["f0_method"], open=
|
| 23 |
with gr.Group():
|
| 24 |
with gr.Row():
|
| 25 |
onnx_f0_mode3 = gr.Checkbox(label=translations["f0_onnx_mode"], info=translations["f0_onnx_mode_info"], value=False, interactive=True)
|
|
@@ -48,4 +48,4 @@ def f0_extract_tab():
|
|
| 48 |
],
|
| 49 |
outputs=[file_output, image_output],
|
| 50 |
api_name="f0_extract"
|
| 51 |
-
)
|
|
|
|
| 19 |
upload_audio_file = gr.Files(label=translations["drop_audio"], file_types=file_types)
|
| 20 |
audioplay = gr.Audio(show_download_button=True, interactive=False, label=translations["input_audio"])
|
| 21 |
with gr.Column():
|
| 22 |
+
with gr.Accordion(translations["f0_method"], open=True):
|
| 23 |
with gr.Group():
|
| 24 |
with gr.Row():
|
| 25 |
onnx_f0_mode3 = gr.Checkbox(label=translations["f0_onnx_mode"], info=translations["f0_onnx_mode_info"], value=False, interactive=True)
|
|
|
|
| 48 |
],
|
| 49 |
outputs=[file_output, image_output],
|
| 50 |
api_name="f0_extract"
|
| 51 |
+
)
|
main/app/tabs/extra/child/settings.py
CHANGED
|
@@ -31,11 +31,11 @@ def settings_tab(app):
|
|
| 31 |
font_button = gr.Button(translations["change_font"])
|
| 32 |
with gr.Row():
|
| 33 |
with gr.Column():
|
| 34 |
-
with gr.Accordion(translations["stop"], open=
|
| 35 |
separate_stop = gr.Button(translations["stop_separate"])
|
| 36 |
convert_stop = gr.Button(translations["stop_convert"])
|
| 37 |
create_dataset_stop = gr.Button(translations["stop_create_dataset"])
|
| 38 |
-
with gr.Accordion(translations["stop_training"], open=
|
| 39 |
model_name_stop = gr.Textbox(label=translations["modelname"], info=translations["training_model_name"], value="", placeholder=translations["modelname"], interactive=True)
|
| 40 |
preprocess_stop = gr.Button(translations["stop_preprocess"])
|
| 41 |
extract_stop = gr.Button(translations["stop_extract"])
|
|
@@ -58,4 +58,4 @@ def settings_tab(app):
|
|
| 58 |
with gr.Row():
|
| 59 |
preprocess_stop.click(fn=lambda model_name_stop: stop_pid("preprocess_pid", model_name_stop, False), inputs=[model_name_stop], outputs=[])
|
| 60 |
extract_stop.click(fn=lambda model_name_stop: stop_pid("extract_pid", model_name_stop, False), inputs=[model_name_stop], outputs=[])
|
| 61 |
-
train_stop.click(fn=lambda model_name_stop: stop_pid("train_pid", model_name_stop, True), inputs=[model_name_stop], outputs=[])
|
|
|
|
| 31 |
font_button = gr.Button(translations["change_font"])
|
| 32 |
with gr.Row():
|
| 33 |
with gr.Column():
|
| 34 |
+
with gr.Accordion(translations["stop"], open=True, visible=True):
|
| 35 |
separate_stop = gr.Button(translations["stop_separate"])
|
| 36 |
convert_stop = gr.Button(translations["stop_convert"])
|
| 37 |
create_dataset_stop = gr.Button(translations["stop_create_dataset"])
|
| 38 |
+
with gr.Accordion(translations["stop_training"], open=True):
|
| 39 |
model_name_stop = gr.Textbox(label=translations["modelname"], info=translations["training_model_name"], value="", placeholder=translations["modelname"], interactive=True)
|
| 40 |
preprocess_stop = gr.Button(translations["stop_preprocess"])
|
| 41 |
extract_stop = gr.Button(translations["stop_extract"])
|
|
|
|
| 58 |
with gr.Row():
|
| 59 |
preprocess_stop.click(fn=lambda model_name_stop: stop_pid("preprocess_pid", model_name_stop, False), inputs=[model_name_stop], outputs=[])
|
| 60 |
extract_stop.click(fn=lambda model_name_stop: stop_pid("extract_pid", model_name_stop, False), inputs=[model_name_stop], outputs=[])
|
| 61 |
+
train_stop.click(fn=lambda model_name_stop: stop_pid("train_pid", model_name_stop, True), inputs=[model_name_stop], outputs=[])
|
main/app/tabs/inference/child/convert.py
CHANGED
|
@@ -7,8 +7,38 @@ sys.path.append(os.getcwd())
|
|
| 7 |
|
| 8 |
from main.app.core.presets import load_presets, save_presets
|
| 9 |
from main.app.core.inference import convert_audio, convert_selection
|
| 10 |
-
from main.app.variables import
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
def convert_tab():
|
| 14 |
with gr.Row():
|
|
@@ -17,225 +47,677 @@ def convert_tab():
|
|
| 17 |
with gr.Column():
|
| 18 |
with gr.Group():
|
| 19 |
with gr.Row():
|
| 20 |
-
cleaner0 = gr.Checkbox(
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
with gr.Row():
|
| 25 |
-
use_original = gr.Checkbox(
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
with gr.Row():
|
| 30 |
-
pitch = gr.Slider(minimum=-20, maximum=20, step=1, info=translations["pitch_info"], label=translations["pitch"], value=0, interactive=True)
|
| 31 |
-
clean_strength0 = gr.Slider(label=translations["clean_strength"], info=translations["clean_strength_info"], minimum=0, maximum=1, value=0.5, step=0.1, interactive=True, visible=cleaner0.value)
|
| 32 |
-
with gr.Row():
|
| 33 |
with gr.Column():
|
| 34 |
-
audio_select = gr.Dropdown(
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
with gr.Row():
|
| 37 |
with gr.Column():
|
| 38 |
convert_button = gr.Button(translations["convert_audio"], variant="primary")
|
| 39 |
with gr.Row():
|
| 40 |
with gr.Column():
|
| 41 |
-
input0 = gr.Files(label=translations["drop_audio"], file_types=file_types)
|
| 42 |
-
play_audio = gr.Audio(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
with gr.Column():
|
| 44 |
with gr.Accordion(translations["model_accordion"], open=True):
|
| 45 |
with gr.Row():
|
| 46 |
-
model_pth = gr.Dropdown(
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
with gr.Row():
|
| 49 |
refresh = gr.Button(translations["refresh"])
|
| 50 |
with gr.Row():
|
| 51 |
-
index_strength = gr.Slider(
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
with gr.Column():
|
| 54 |
-
export_format = gr.Radio(
|
| 55 |
-
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
with gr.Column():
|
| 58 |
refresh0 = gr.Button(translations["refresh"])
|
| 59 |
-
with gr.Accordion(translations["setting"], open=
|
| 60 |
-
with gr.Accordion(translations["f0_method"], open=
|
| 61 |
with gr.Group():
|
| 62 |
with gr.Row():
|
| 63 |
-
onnx_f0_mode = gr.Checkbox(
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
refresh_f0_file = gr.Button(translations["refresh"])
|
| 73 |
-
with gr.Accordion(translations["hubert_model"], open=
|
| 74 |
-
embed_mode = gr.Radio(
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
with gr.Row():
|
| 79 |
-
presets_name = gr.Dropdown(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
with gr.Row():
|
| 81 |
-
load_click = gr.Button(
|
|
|
|
|
|
|
| 82 |
refresh_click = gr.Button(translations["refresh"])
|
| 83 |
with gr.Accordion(translations["export_file"], open=False):
|
| 84 |
with gr.Row():
|
| 85 |
with gr.Column():
|
| 86 |
with gr.Group():
|
| 87 |
with gr.Row():
|
| 88 |
-
cleaner_chbox = gr.Checkbox(
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
with gr.Row():
|
| 99 |
with gr.Column():
|
| 100 |
-
name_to_save_file = gr.Textbox(
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
with gr.Row():
|
| 103 |
-
upload_presets = gr.Files(
|
|
|
|
|
|
|
|
|
|
| 104 |
with gr.Column():
|
| 105 |
with gr.Group():
|
| 106 |
with gr.Row():
|
| 107 |
-
split_audio = gr.Checkbox(
|
| 108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
with gr.Row():
|
| 110 |
-
proposal_pitch = gr.Checkbox(
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
with gr.Row():
|
| 119 |
-
formant_qfrency = gr.Slider(
|
| 120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
with gr.Row():
|
| 122 |
gr.Markdown(translations["output_convert"])
|
| 123 |
with gr.Row():
|
| 124 |
-
main_convert = gr.Audio(
|
| 125 |
-
|
| 126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
with gr.Row():
|
| 128 |
-
original_convert = gr.Audio(
|
| 129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
with gr.Row():
|
| 131 |
-
upload_f0_file.upload(
|
| 132 |
-
|
| 133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
with gr.Row():
|
| 135 |
load_click.click(
|
| 136 |
-
fn=load_presets,
|
| 137 |
inputs=[
|
| 138 |
-
presets_name,
|
| 139 |
-
cleaner0,
|
| 140 |
-
autotune,
|
| 141 |
-
pitch,
|
| 142 |
-
clean_strength0,
|
| 143 |
-
index_strength,
|
| 144 |
-
resample_sr,
|
| 145 |
-
filter_radius,
|
| 146 |
-
rms_mix_rate,
|
| 147 |
-
protect,
|
| 148 |
-
split_audio,
|
| 149 |
f0_autotune_strength,
|
| 150 |
-
formant_shifting,
|
| 151 |
-
formant_qfrency,
|
| 152 |
formant_timbre,
|
| 153 |
proposal_pitch,
|
| 154 |
-
proposal_pitch_threshold
|
| 155 |
-
],
|
| 156 |
outputs=[
|
| 157 |
-
cleaner0,
|
| 158 |
-
autotune,
|
| 159 |
-
pitch,
|
| 160 |
-
clean_strength0,
|
| 161 |
-
index_strength,
|
| 162 |
-
resample_sr,
|
| 163 |
-
filter_radius,
|
| 164 |
-
rms_mix_rate,
|
| 165 |
-
protect,
|
| 166 |
-
split_audio,
|
| 167 |
-
f0_autotune_strength,
|
| 168 |
-
formant_shifting,
|
| 169 |
-
formant_qfrency,
|
| 170 |
formant_timbre,
|
| 171 |
proposal_pitch,
|
| 172 |
-
proposal_pitch_threshold
|
| 173 |
-
]
|
| 174 |
)
|
| 175 |
refresh_click.click(fn=change_preset_choices, inputs=[], outputs=[presets_name])
|
| 176 |
save_file_button.click(
|
| 177 |
-
fn=save_presets,
|
| 178 |
inputs=[
|
| 179 |
-
name_to_save_file,
|
| 180 |
-
cleaner0,
|
| 181 |
-
autotune,
|
| 182 |
-
pitch,
|
| 183 |
-
clean_strength0,
|
| 184 |
-
index_strength,
|
| 185 |
-
resample_sr,
|
| 186 |
-
filter_radius,
|
| 187 |
-
rms_mix_rate,
|
| 188 |
-
protect,
|
| 189 |
-
split_audio,
|
| 190 |
-
f0_autotune_strength,
|
| 191 |
-
cleaner_chbox,
|
| 192 |
-
autotune_chbox,
|
| 193 |
-
pitch_chbox,
|
| 194 |
-
index_strength_chbox,
|
| 195 |
-
resample_sr_chbox,
|
| 196 |
-
filter_radius_chbox,
|
| 197 |
-
rms_mix_rate_chbox,
|
| 198 |
-
protect_chbox,
|
| 199 |
-
split_audio_chbox,
|
| 200 |
-
formant_shifting_chbox,
|
| 201 |
-
formant_shifting,
|
| 202 |
-
formant_qfrency,
|
| 203 |
formant_timbre,
|
| 204 |
proposal_pitch,
|
| 205 |
-
proposal_pitch_threshold
|
| 206 |
-
],
|
| 207 |
-
outputs=[presets_name]
|
| 208 |
)
|
| 209 |
with gr.Row():
|
| 210 |
-
upload_presets.upload(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 211 |
autotune.change(fn=visible, inputs=[autotune], outputs=[f0_autotune_strength])
|
| 212 |
-
use_audio.change(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
with gr.Row():
|
| 214 |
-
convert_backing.change(
|
| 215 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
cleaner0.change(fn=visible, inputs=[cleaner0], outputs=[clean_strength0])
|
| 217 |
with gr.Row():
|
| 218 |
-
merge_instrument.change(
|
| 219 |
-
|
| 220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 221 |
with gr.Row():
|
| 222 |
-
hybrid_method.change(
|
| 223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
model_pth.change(fn=get_index, inputs=[model_pth], outputs=[model_index])
|
| 225 |
with gr.Row():
|
| 226 |
-
input0.upload(
|
| 227 |
-
|
| 228 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
with gr.Row():
|
| 230 |
-
embedders.change(
|
| 231 |
-
|
| 232 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
with gr.Row():
|
| 234 |
-
convert_button.click(
|
| 235 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 236 |
with gr.Row():
|
| 237 |
-
proposal_pitch.change(
|
| 238 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
with gr.Row():
|
| 240 |
convert_button.click(
|
| 241 |
fn=convert_selection,
|
|
@@ -268,18 +750,27 @@ def convert_tab():
|
|
| 268 |
f0_autotune_strength,
|
| 269 |
checkpointing,
|
| 270 |
onnx_f0_mode,
|
| 271 |
-
formant_shifting,
|
| 272 |
-
formant_qfrency,
|
| 273 |
formant_timbre,
|
| 274 |
f0_file_dropdown,
|
| 275 |
embed_mode,
|
| 276 |
proposal_pitch,
|
| 277 |
proposal_pitch_threshold,
|
| 278 |
audio_processing,
|
| 279 |
-
alpha
|
| 280 |
],
|
| 281 |
-
outputs=[
|
| 282 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 283 |
)
|
| 284 |
convert_button_2.click(
|
| 285 |
fn=convert_audio,
|
|
@@ -313,16 +804,23 @@ def convert_tab():
|
|
| 313 |
audio_select,
|
| 314 |
checkpointing,
|
| 315 |
onnx_f0_mode,
|
| 316 |
-
formant_shifting,
|
| 317 |
-
formant_qfrency,
|
| 318 |
formant_timbre,
|
| 319 |
f0_file_dropdown,
|
| 320 |
embed_mode,
|
| 321 |
proposal_pitch,
|
| 322 |
proposal_pitch_threshold,
|
| 323 |
audio_processing,
|
| 324 |
-
alpha
|
| 325 |
],
|
| 326 |
-
outputs=[
|
| 327 |
-
|
| 328 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
from main.app.core.presets import load_presets, save_presets
|
| 9 |
from main.app.core.inference import convert_audio, convert_selection
|
| 10 |
+
from main.app.variables import (
|
| 11 |
+
translations,
|
| 12 |
+
paths_for_files,
|
| 13 |
+
sample_rate_choice,
|
| 14 |
+
model_name,
|
| 15 |
+
index_path,
|
| 16 |
+
method_f0,
|
| 17 |
+
f0_file,
|
| 18 |
+
embedders_mode,
|
| 19 |
+
embedders_model,
|
| 20 |
+
presets_file,
|
| 21 |
+
configs,
|
| 22 |
+
file_types,
|
| 23 |
+
export_format_choices,
|
| 24 |
+
hybrid_f0_method,
|
| 25 |
+
)
|
| 26 |
+
from main.app.core.ui import (
|
| 27 |
+
visible,
|
| 28 |
+
valueFalse_interactive,
|
| 29 |
+
change_audios_choices,
|
| 30 |
+
change_f0_choices,
|
| 31 |
+
unlock_f0,
|
| 32 |
+
change_preset_choices,
|
| 33 |
+
change_backing_choices,
|
| 34 |
+
hoplength_show,
|
| 35 |
+
change_models_choices,
|
| 36 |
+
get_index,
|
| 37 |
+
index_strength_show,
|
| 38 |
+
change_embedders_mode,
|
| 39 |
+
shutil_move,
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
|
| 43 |
def convert_tab():
|
| 44 |
with gr.Row():
|
|
|
|
| 47 |
with gr.Column():
|
| 48 |
with gr.Group():
|
| 49 |
with gr.Row():
|
| 50 |
+
cleaner0 = gr.Checkbox(
|
| 51 |
+
label=translations["clear_audio"], value=False, interactive=True
|
| 52 |
+
)
|
| 53 |
+
autotune = gr.Checkbox(
|
| 54 |
+
label=translations["autotune"], value=False, interactive=True
|
| 55 |
+
)
|
| 56 |
+
use_audio = gr.Checkbox(
|
| 57 |
+
label=translations["use_audio"], value=False, interactive=True
|
| 58 |
+
)
|
| 59 |
+
checkpointing = gr.Checkbox(
|
| 60 |
+
label=translations["memory_efficient_training"],
|
| 61 |
+
value=False,
|
| 62 |
+
interactive=True,
|
| 63 |
+
)
|
| 64 |
with gr.Row():
|
| 65 |
+
use_original = gr.Checkbox(
|
| 66 |
+
label=translations["convert_original"],
|
| 67 |
+
value=False,
|
| 68 |
+
interactive=True,
|
| 69 |
+
visible=use_audio.value,
|
| 70 |
+
)
|
| 71 |
+
convert_backing = gr.Checkbox(
|
| 72 |
+
label=translations["convert_backing"],
|
| 73 |
+
value=False,
|
| 74 |
+
interactive=True,
|
| 75 |
+
visible=use_audio.value,
|
| 76 |
+
)
|
| 77 |
+
not_merge_backing = gr.Checkbox(
|
| 78 |
+
label=translations["not_merge_backing"],
|
| 79 |
+
value=False,
|
| 80 |
+
interactive=True,
|
| 81 |
+
visible=use_audio.value,
|
| 82 |
+
)
|
| 83 |
+
merge_instrument = gr.Checkbox(
|
| 84 |
+
label=translations["merge_instruments"],
|
| 85 |
+
value=False,
|
| 86 |
+
interactive=True,
|
| 87 |
+
visible=use_audio.value,
|
| 88 |
+
)
|
| 89 |
+
with gr.Row():
|
| 90 |
+
pitch = gr.Slider(
|
| 91 |
+
minimum=-20,
|
| 92 |
+
maximum=20,
|
| 93 |
+
step=1,
|
| 94 |
+
info=translations["pitch_info"],
|
| 95 |
+
label=translations["pitch"],
|
| 96 |
+
value=0,
|
| 97 |
+
interactive=True,
|
| 98 |
+
)
|
| 99 |
+
clean_strength0 = gr.Slider(
|
| 100 |
+
label=translations["clean_strength"],
|
| 101 |
+
info=translations["clean_strength_info"],
|
| 102 |
+
minimum=0,
|
| 103 |
+
maximum=1,
|
| 104 |
+
value=0.5,
|
| 105 |
+
step=0.1,
|
| 106 |
+
interactive=True,
|
| 107 |
+
visible=cleaner0.value,
|
| 108 |
+
)
|
| 109 |
with gr.Row():
|
|
|
|
|
|
|
|
|
|
| 110 |
with gr.Column():
|
| 111 |
+
audio_select = gr.Dropdown(
|
| 112 |
+
label=translations["select_separate"],
|
| 113 |
+
choices=[],
|
| 114 |
+
value="",
|
| 115 |
+
interactive=True,
|
| 116 |
+
allow_custom_value=True,
|
| 117 |
+
visible=False,
|
| 118 |
+
)
|
| 119 |
+
convert_button_2 = gr.Button(
|
| 120 |
+
translations["convert_audio"], visible=False
|
| 121 |
+
)
|
| 122 |
with gr.Row():
|
| 123 |
with gr.Column():
|
| 124 |
convert_button = gr.Button(translations["convert_audio"], variant="primary")
|
| 125 |
with gr.Row():
|
| 126 |
with gr.Column():
|
| 127 |
+
input0 = gr.Files(label=translations["drop_audio"], file_types=file_types)
|
| 128 |
+
play_audio = gr.Audio(
|
| 129 |
+
show_download_button=True,
|
| 130 |
+
interactive=False,
|
| 131 |
+
label=translations["input_audio"],
|
| 132 |
+
)
|
| 133 |
with gr.Column():
|
| 134 |
with gr.Accordion(translations["model_accordion"], open=True):
|
| 135 |
with gr.Row():
|
| 136 |
+
model_pth = gr.Dropdown(
|
| 137 |
+
label=translations["model_name"],
|
| 138 |
+
choices=model_name,
|
| 139 |
+
value=model_name[0] if len(model_name) >= 1 else "",
|
| 140 |
+
interactive=True,
|
| 141 |
+
allow_custom_value=True,
|
| 142 |
+
)
|
| 143 |
+
model_index = gr.Dropdown(
|
| 144 |
+
label=translations["index_path"],
|
| 145 |
+
choices=index_path,
|
| 146 |
+
value=index_path[0] if len(index_path) >= 1 else "",
|
| 147 |
+
interactive=True,
|
| 148 |
+
allow_custom_value=True,
|
| 149 |
+
)
|
| 150 |
with gr.Row():
|
| 151 |
refresh = gr.Button(translations["refresh"])
|
| 152 |
with gr.Row():
|
| 153 |
+
index_strength = gr.Slider(
|
| 154 |
+
label=translations["index_strength"],
|
| 155 |
+
info=translations["index_strength_info"],
|
| 156 |
+
minimum=0,
|
| 157 |
+
maximum=1,
|
| 158 |
+
value=0.5,
|
| 159 |
+
step=0.01,
|
| 160 |
+
interactive=True,
|
| 161 |
+
visible=model_index.value != "",
|
| 162 |
+
)
|
| 163 |
+
with gr.Accordion(translations["input_output"], open=True):
|
| 164 |
with gr.Column():
|
| 165 |
+
export_format = gr.Radio(
|
| 166 |
+
label=translations["export_format"],
|
| 167 |
+
info=translations["export_info"],
|
| 168 |
+
choices=export_format_choices,
|
| 169 |
+
value="wav",
|
| 170 |
+
interactive=True,
|
| 171 |
+
)
|
| 172 |
+
input_audio0 = gr.Dropdown(
|
| 173 |
+
label=translations["audio_path"],
|
| 174 |
+
value="",
|
| 175 |
+
choices=paths_for_files,
|
| 176 |
+
info=translations["provide_audio"],
|
| 177 |
+
allow_custom_value=True,
|
| 178 |
+
interactive=True,
|
| 179 |
+
)
|
| 180 |
+
output_audio = gr.Textbox(
|
| 181 |
+
label=translations["output_path"],
|
| 182 |
+
value="audios/output.wav",
|
| 183 |
+
placeholder="audios/output.wav",
|
| 184 |
+
info=translations["output_path_info"],
|
| 185 |
+
interactive=True,
|
| 186 |
+
allow_custom_value=False,
|
| 187 |
+
)
|
| 188 |
with gr.Column():
|
| 189 |
refresh0 = gr.Button(translations["refresh"])
|
| 190 |
+
with gr.Accordion(translations["setting"], open=True):
|
| 191 |
+
with gr.Accordion(translations["f0_method"], open=True):
|
| 192 |
with gr.Group():
|
| 193 |
with gr.Row():
|
| 194 |
+
onnx_f0_mode = gr.Checkbox(
|
| 195 |
+
label=translations["f0_onnx_mode"],
|
| 196 |
+
info=translations["f0_onnx_mode_info"],
|
| 197 |
+
value=False,
|
| 198 |
+
interactive=True,
|
| 199 |
+
)
|
| 200 |
+
unlock_full_method = gr.Checkbox(
|
| 201 |
+
label=translations["f0_unlock"],
|
| 202 |
+
info=translations["f0_unlock_info"],
|
| 203 |
+
value=False,
|
| 204 |
+
interactive=True,
|
| 205 |
+
)
|
| 206 |
+
method = gr.Radio(
|
| 207 |
+
label=translations["f0_method"],
|
| 208 |
+
info=translations["f0_method_info"],
|
| 209 |
+
choices=method_f0,
|
| 210 |
+
value="rmvpe",
|
| 211 |
+
interactive=True,
|
| 212 |
+
)
|
| 213 |
+
hybrid_method = gr.Dropdown(
|
| 214 |
+
label=translations["f0_method_hybrid"],
|
| 215 |
+
info=translations["f0_method_hybrid_info"],
|
| 216 |
+
choices=hybrid_f0_method,
|
| 217 |
+
value=hybrid_f0_method[0],
|
| 218 |
+
interactive=True,
|
| 219 |
+
allow_custom_value=True,
|
| 220 |
+
visible=method.value == "hybrid",
|
| 221 |
+
)
|
| 222 |
+
hop_length = gr.Slider(
|
| 223 |
+
label=translations["hop_length"],
|
| 224 |
+
info=translations["hop_length_info"],
|
| 225 |
+
minimum=64,
|
| 226 |
+
maximum=512,
|
| 227 |
+
value=160,
|
| 228 |
+
step=1,
|
| 229 |
+
interactive=True,
|
| 230 |
+
visible=False,
|
| 231 |
+
)
|
| 232 |
+
alpha = gr.Slider(
|
| 233 |
+
label=translations["alpha_label"],
|
| 234 |
+
info=translations["alpha_info"],
|
| 235 |
+
minimum=0.1,
|
| 236 |
+
maximum=1,
|
| 237 |
+
value=0.5,
|
| 238 |
+
step=0.1,
|
| 239 |
+
interactive=True,
|
| 240 |
+
visible=False,
|
| 241 |
+
)
|
| 242 |
+
with gr.Accordion(translations["f0_file"], open=True):
|
| 243 |
+
upload_f0_file = gr.File(
|
| 244 |
+
label=translations["upload_f0"], file_types=[".txt"]
|
| 245 |
+
)
|
| 246 |
+
f0_file_dropdown = gr.Dropdown(
|
| 247 |
+
label=translations["f0_file_2"],
|
| 248 |
+
value="",
|
| 249 |
+
choices=f0_file,
|
| 250 |
+
allow_custom_value=True,
|
| 251 |
+
interactive=True,
|
| 252 |
+
)
|
| 253 |
refresh_f0_file = gr.Button(translations["refresh"])
|
| 254 |
+
with gr.Accordion(translations["hubert_model"], open=True):
|
| 255 |
+
embed_mode = gr.Radio(
|
| 256 |
+
label=translations["embed_mode"],
|
| 257 |
+
info=translations["embed_mode_info"],
|
| 258 |
+
value="fairseq",
|
| 259 |
+
choices=embedders_mode,
|
| 260 |
+
interactive=True,
|
| 261 |
+
visible=True,
|
| 262 |
+
)
|
| 263 |
+
embedders = gr.Radio(
|
| 264 |
+
label=translations["hubert_model"],
|
| 265 |
+
info=translations["hubert_info"],
|
| 266 |
+
choices=embedders_model,
|
| 267 |
+
value="hubert_base",
|
| 268 |
+
interactive=True,
|
| 269 |
+
)
|
| 270 |
+
custom_embedders = gr.Textbox(
|
| 271 |
+
label=translations["modelname"],
|
| 272 |
+
info=translations["modelname_info"],
|
| 273 |
+
value="",
|
| 274 |
+
placeholder="hubert_base",
|
| 275 |
+
interactive=True,
|
| 276 |
+
visible=embedders.value == "custom",
|
| 277 |
+
)
|
| 278 |
+
with gr.Accordion(translations["use_presets"], open=True):
|
| 279 |
with gr.Row():
|
| 280 |
+
presets_name = gr.Dropdown(
|
| 281 |
+
label=translations["file_preset"],
|
| 282 |
+
choices=presets_file,
|
| 283 |
+
value=presets_file[0] if len(presets_file) > 0 else "",
|
| 284 |
+
interactive=True,
|
| 285 |
+
allow_custom_value=True,
|
| 286 |
+
)
|
| 287 |
with gr.Row():
|
| 288 |
+
load_click = gr.Button(
|
| 289 |
+
translations["load_file"], variant="primary"
|
| 290 |
+
)
|
| 291 |
refresh_click = gr.Button(translations["refresh"])
|
| 292 |
with gr.Accordion(translations["export_file"], open=False):
|
| 293 |
with gr.Row():
|
| 294 |
with gr.Column():
|
| 295 |
with gr.Group():
|
| 296 |
with gr.Row():
|
| 297 |
+
cleaner_chbox = gr.Checkbox(
|
| 298 |
+
label=translations["save_clean"],
|
| 299 |
+
value=True,
|
| 300 |
+
interactive=True,
|
| 301 |
+
)
|
| 302 |
+
autotune_chbox = gr.Checkbox(
|
| 303 |
+
label=translations["save_autotune"],
|
| 304 |
+
value=True,
|
| 305 |
+
interactive=True,
|
| 306 |
+
)
|
| 307 |
+
pitch_chbox = gr.Checkbox(
|
| 308 |
+
label=translations["save_pitch"],
|
| 309 |
+
value=True,
|
| 310 |
+
interactive=True,
|
| 311 |
+
)
|
| 312 |
+
index_strength_chbox = gr.Checkbox(
|
| 313 |
+
label=translations["save_index_2"],
|
| 314 |
+
value=True,
|
| 315 |
+
interactive=True,
|
| 316 |
+
)
|
| 317 |
+
resample_sr_chbox = gr.Checkbox(
|
| 318 |
+
label=translations["save_resample"],
|
| 319 |
+
value=True,
|
| 320 |
+
interactive=True,
|
| 321 |
+
)
|
| 322 |
+
filter_radius_chbox = gr.Checkbox(
|
| 323 |
+
label=translations["save_filter"],
|
| 324 |
+
value=True,
|
| 325 |
+
interactive=True,
|
| 326 |
+
)
|
| 327 |
+
rms_mix_rate_chbox = gr.Checkbox(
|
| 328 |
+
label=translations["save_envelope"],
|
| 329 |
+
value=True,
|
| 330 |
+
interactive=True,
|
| 331 |
+
)
|
| 332 |
+
protect_chbox = gr.Checkbox(
|
| 333 |
+
label=translations["save_protect"],
|
| 334 |
+
value=True,
|
| 335 |
+
interactive=True,
|
| 336 |
+
)
|
| 337 |
+
split_audio_chbox = gr.Checkbox(
|
| 338 |
+
label=translations["save_split"],
|
| 339 |
+
value=True,
|
| 340 |
+
interactive=True,
|
| 341 |
+
)
|
| 342 |
+
formant_shifting_chbox = gr.Checkbox(
|
| 343 |
+
label=translations["formantshift"],
|
| 344 |
+
value=True,
|
| 345 |
+
interactive=True,
|
| 346 |
+
)
|
| 347 |
with gr.Row():
|
| 348 |
with gr.Column():
|
| 349 |
+
name_to_save_file = gr.Textbox(
|
| 350 |
+
label=translations["filename_to_save"]
|
| 351 |
+
)
|
| 352 |
+
save_file_button = gr.Button(
|
| 353 |
+
translations["export_file"]
|
| 354 |
+
)
|
| 355 |
with gr.Row():
|
| 356 |
+
upload_presets = gr.Files(
|
| 357 |
+
label=translations["upload_presets"],
|
| 358 |
+
file_types=[".conversion.json"],
|
| 359 |
+
)
|
| 360 |
with gr.Column():
|
| 361 |
with gr.Group():
|
| 362 |
with gr.Row():
|
| 363 |
+
split_audio = gr.Checkbox(
|
| 364 |
+
label=translations["split_audio"],
|
| 365 |
+
value=False,
|
| 366 |
+
interactive=True,
|
| 367 |
+
)
|
| 368 |
+
formant_shifting = gr.Checkbox(
|
| 369 |
+
label=translations["formantshift"],
|
| 370 |
+
value=False,
|
| 371 |
+
interactive=True,
|
| 372 |
+
)
|
| 373 |
with gr.Row():
|
| 374 |
+
proposal_pitch = gr.Checkbox(
|
| 375 |
+
label=translations["proposal_pitch"],
|
| 376 |
+
value=False,
|
| 377 |
+
interactive=True,
|
| 378 |
+
)
|
| 379 |
+
audio_processing = gr.Checkbox(
|
| 380 |
+
label=translations["audio_processing"],
|
| 381 |
+
value=False,
|
| 382 |
+
interactive=True,
|
| 383 |
+
)
|
| 384 |
+
resample_sr = gr.Radio(
|
| 385 |
+
choices=[0] + sample_rate_choice,
|
| 386 |
+
label=translations["resample"],
|
| 387 |
+
info=translations["resample_info"],
|
| 388 |
+
value=0,
|
| 389 |
+
interactive=True,
|
| 390 |
+
)
|
| 391 |
+
proposal_pitch_threshold = gr.Slider(
|
| 392 |
+
minimum=50.0,
|
| 393 |
+
maximum=1200.0,
|
| 394 |
+
label=translations["proposal_pitch_threshold"],
|
| 395 |
+
info=translations["proposal_pitch_threshold_info"],
|
| 396 |
+
value=255.0,
|
| 397 |
+
step=0.1,
|
| 398 |
+
interactive=True,
|
| 399 |
+
visible=proposal_pitch.value,
|
| 400 |
+
)
|
| 401 |
+
f0_autotune_strength = gr.Slider(
|
| 402 |
+
minimum=0,
|
| 403 |
+
maximum=1,
|
| 404 |
+
label=translations["autotune_rate"],
|
| 405 |
+
info=translations["autotune_rate_info"],
|
| 406 |
+
value=1,
|
| 407 |
+
step=0.1,
|
| 408 |
+
interactive=True,
|
| 409 |
+
visible=autotune.value,
|
| 410 |
+
)
|
| 411 |
+
filter_radius = gr.Slider(
|
| 412 |
+
minimum=0,
|
| 413 |
+
maximum=7,
|
| 414 |
+
label=translations["filter_radius"],
|
| 415 |
+
info=translations["filter_radius_info"],
|
| 416 |
+
value=3,
|
| 417 |
+
step=1,
|
| 418 |
+
interactive=True,
|
| 419 |
+
)
|
| 420 |
+
rms_mix_rate = gr.Slider(
|
| 421 |
+
minimum=0,
|
| 422 |
+
maximum=1,
|
| 423 |
+
label=translations["rms_mix_rate"],
|
| 424 |
+
info=translations["rms_mix_rate_info"],
|
| 425 |
+
value=1,
|
| 426 |
+
step=0.1,
|
| 427 |
+
interactive=True,
|
| 428 |
+
)
|
| 429 |
+
protect = gr.Slider(
|
| 430 |
+
minimum=0,
|
| 431 |
+
maximum=1,
|
| 432 |
+
label=translations["protect"],
|
| 433 |
+
info=translations["protect_info"],
|
| 434 |
+
value=0.5,
|
| 435 |
+
step=0.01,
|
| 436 |
+
interactive=True,
|
| 437 |
+
)
|
| 438 |
with gr.Row():
|
| 439 |
+
formant_qfrency = gr.Slider(
|
| 440 |
+
value=1.0,
|
| 441 |
+
label=translations["formant_qfrency"],
|
| 442 |
+
info=translations["formant_qfrency"],
|
| 443 |
+
minimum=0.0,
|
| 444 |
+
maximum=16.0,
|
| 445 |
+
step=0.1,
|
| 446 |
+
interactive=True,
|
| 447 |
+
visible=False,
|
| 448 |
+
)
|
| 449 |
+
formant_timbre = gr.Slider(
|
| 450 |
+
value=1.0,
|
| 451 |
+
label=translations["formant_timbre"],
|
| 452 |
+
info=translations["formant_timbre"],
|
| 453 |
+
minimum=0.0,
|
| 454 |
+
maximum=16.0,
|
| 455 |
+
step=0.1,
|
| 456 |
+
interactive=True,
|
| 457 |
+
visible=False,
|
| 458 |
+
)
|
| 459 |
with gr.Row():
|
| 460 |
gr.Markdown(translations["output_convert"])
|
| 461 |
with gr.Row():
|
| 462 |
+
main_convert = gr.Audio(
|
| 463 |
+
show_download_button=True,
|
| 464 |
+
interactive=False,
|
| 465 |
+
label=translations["main_convert"],
|
| 466 |
+
)
|
| 467 |
+
backing_convert = gr.Audio(
|
| 468 |
+
show_download_button=True,
|
| 469 |
+
interactive=False,
|
| 470 |
+
label=translations["convert_backing"],
|
| 471 |
+
visible=convert_backing.value,
|
| 472 |
+
)
|
| 473 |
+
main_backing = gr.Audio(
|
| 474 |
+
show_download_button=True,
|
| 475 |
+
interactive=False,
|
| 476 |
+
label=translations["main_or_backing"],
|
| 477 |
+
visible=convert_backing.value,
|
| 478 |
+
)
|
| 479 |
with gr.Row():
|
| 480 |
+
original_convert = gr.Audio(
|
| 481 |
+
show_download_button=True,
|
| 482 |
+
interactive=False,
|
| 483 |
+
label=translations["convert_original"],
|
| 484 |
+
visible=use_original.value,
|
| 485 |
+
)
|
| 486 |
+
vocal_instrument = gr.Audio(
|
| 487 |
+
show_download_button=True,
|
| 488 |
+
interactive=False,
|
| 489 |
+
label=translations["voice_or_instruments"],
|
| 490 |
+
visible=merge_instrument.value,
|
| 491 |
+
)
|
| 492 |
with gr.Row():
|
| 493 |
+
upload_f0_file.upload(
|
| 494 |
+
fn=lambda inp: shutil_move(inp.name, configs["f0_path"]),
|
| 495 |
+
inputs=[upload_f0_file],
|
| 496 |
+
outputs=[f0_file_dropdown],
|
| 497 |
+
)
|
| 498 |
+
refresh_f0_file.click(
|
| 499 |
+
fn=change_f0_choices, inputs=[], outputs=[f0_file_dropdown]
|
| 500 |
+
)
|
| 501 |
+
unlock_full_method.change(
|
| 502 |
+
fn=unlock_f0, inputs=[unlock_full_method], outputs=[method]
|
| 503 |
+
)
|
| 504 |
with gr.Row():
|
| 505 |
load_click.click(
|
| 506 |
+
fn=load_presets,
|
| 507 |
inputs=[
|
| 508 |
+
presets_name,
|
| 509 |
+
cleaner0,
|
| 510 |
+
autotune,
|
| 511 |
+
pitch,
|
| 512 |
+
clean_strength0,
|
| 513 |
+
index_strength,
|
| 514 |
+
resample_sr,
|
| 515 |
+
filter_radius,
|
| 516 |
+
rms_mix_rate,
|
| 517 |
+
protect,
|
| 518 |
+
split_audio,
|
| 519 |
f0_autotune_strength,
|
| 520 |
+
formant_shifting,
|
| 521 |
+
formant_qfrency,
|
| 522 |
formant_timbre,
|
| 523 |
proposal_pitch,
|
| 524 |
+
proposal_pitch_threshold,
|
| 525 |
+
],
|
| 526 |
outputs=[
|
| 527 |
+
cleaner0,
|
| 528 |
+
autotune,
|
| 529 |
+
pitch,
|
| 530 |
+
clean_strength0,
|
| 531 |
+
index_strength,
|
| 532 |
+
resample_sr,
|
| 533 |
+
filter_radius,
|
| 534 |
+
rms_mix_rate,
|
| 535 |
+
protect,
|
| 536 |
+
split_audio,
|
| 537 |
+
f0_autotune_strength,
|
| 538 |
+
formant_shifting,
|
| 539 |
+
formant_qfrency,
|
| 540 |
formant_timbre,
|
| 541 |
proposal_pitch,
|
| 542 |
+
proposal_pitch_threshold,
|
| 543 |
+
],
|
| 544 |
)
|
| 545 |
refresh_click.click(fn=change_preset_choices, inputs=[], outputs=[presets_name])
|
| 546 |
save_file_button.click(
|
| 547 |
+
fn=save_presets,
|
| 548 |
inputs=[
|
| 549 |
+
name_to_save_file,
|
| 550 |
+
cleaner0,
|
| 551 |
+
autotune,
|
| 552 |
+
pitch,
|
| 553 |
+
clean_strength0,
|
| 554 |
+
index_strength,
|
| 555 |
+
resample_sr,
|
| 556 |
+
filter_radius,
|
| 557 |
+
rms_mix_rate,
|
| 558 |
+
protect,
|
| 559 |
+
split_audio,
|
| 560 |
+
f0_autotune_strength,
|
| 561 |
+
cleaner_chbox,
|
| 562 |
+
autotune_chbox,
|
| 563 |
+
pitch_chbox,
|
| 564 |
+
index_strength_chbox,
|
| 565 |
+
resample_sr_chbox,
|
| 566 |
+
filter_radius_chbox,
|
| 567 |
+
rms_mix_rate_chbox,
|
| 568 |
+
protect_chbox,
|
| 569 |
+
split_audio_chbox,
|
| 570 |
+
formant_shifting_chbox,
|
| 571 |
+
formant_shifting,
|
| 572 |
+
formant_qfrency,
|
| 573 |
formant_timbre,
|
| 574 |
proposal_pitch,
|
| 575 |
+
proposal_pitch_threshold,
|
| 576 |
+
],
|
| 577 |
+
outputs=[presets_name],
|
| 578 |
)
|
| 579 |
with gr.Row():
|
| 580 |
+
upload_presets.upload(
|
| 581 |
+
fn=lambda presets_in: [
|
| 582 |
+
shutil_move(preset.name, configs["presets_path"])
|
| 583 |
+
for preset in presets_in
|
| 584 |
+
][0],
|
| 585 |
+
inputs=[upload_presets],
|
| 586 |
+
outputs=[presets_name],
|
| 587 |
+
)
|
| 588 |
autotune.change(fn=visible, inputs=[autotune], outputs=[f0_autotune_strength])
|
| 589 |
+
use_audio.change(
|
| 590 |
+
fn=lambda a: [
|
| 591 |
+
visible(a),
|
| 592 |
+
visible(a),
|
| 593 |
+
visible(a),
|
| 594 |
+
visible(a),
|
| 595 |
+
visible(a),
|
| 596 |
+
valueFalse_interactive(a),
|
| 597 |
+
valueFalse_interactive(a),
|
| 598 |
+
valueFalse_interactive(a),
|
| 599 |
+
valueFalse_interactive(a),
|
| 600 |
+
visible(not a),
|
| 601 |
+
visible(not a),
|
| 602 |
+
visible(not a),
|
| 603 |
+
visible(not a),
|
| 604 |
+
],
|
| 605 |
+
inputs=[use_audio],
|
| 606 |
+
outputs=[
|
| 607 |
+
main_backing,
|
| 608 |
+
use_original,
|
| 609 |
+
convert_backing,
|
| 610 |
+
not_merge_backing,
|
| 611 |
+
merge_instrument,
|
| 612 |
+
use_original,
|
| 613 |
+
convert_backing,
|
| 614 |
+
not_merge_backing,
|
| 615 |
+
merge_instrument,
|
| 616 |
+
input_audio0,
|
| 617 |
+
output_audio,
|
| 618 |
+
input0,
|
| 619 |
+
play_audio,
|
| 620 |
+
],
|
| 621 |
+
)
|
| 622 |
with gr.Row():
|
| 623 |
+
convert_backing.change(
|
| 624 |
+
fn=lambda a, b: [change_backing_choices(a, b), visible(a)],
|
| 625 |
+
inputs=[convert_backing, not_merge_backing],
|
| 626 |
+
outputs=[use_original, backing_convert],
|
| 627 |
+
)
|
| 628 |
+
use_original.change(
|
| 629 |
+
fn=lambda audio, original: [
|
| 630 |
+
visible(original),
|
| 631 |
+
visible(not original),
|
| 632 |
+
visible(audio and not original),
|
| 633 |
+
valueFalse_interactive(not original),
|
| 634 |
+
valueFalse_interactive(not original),
|
| 635 |
+
],
|
| 636 |
+
inputs=[use_audio, use_original],
|
| 637 |
+
outputs=[
|
| 638 |
+
original_convert,
|
| 639 |
+
main_convert,
|
| 640 |
+
main_backing,
|
| 641 |
+
convert_backing,
|
| 642 |
+
not_merge_backing,
|
| 643 |
+
],
|
| 644 |
+
)
|
| 645 |
cleaner0.change(fn=visible, inputs=[cleaner0], outputs=[clean_strength0])
|
| 646 |
with gr.Row():
|
| 647 |
+
merge_instrument.change(
|
| 648 |
+
fn=visible, inputs=[merge_instrument], outputs=[vocal_instrument]
|
| 649 |
+
)
|
| 650 |
+
not_merge_backing.change(
|
| 651 |
+
fn=lambda audio, merge, cvb: [
|
| 652 |
+
visible(audio and not merge),
|
| 653 |
+
change_backing_choices(cvb, merge),
|
| 654 |
+
],
|
| 655 |
+
inputs=[use_audio, not_merge_backing, convert_backing],
|
| 656 |
+
outputs=[main_backing, use_original],
|
| 657 |
+
)
|
| 658 |
+
method.change(
|
| 659 |
+
fn=lambda method, hybrid: [
|
| 660 |
+
visible(method == "hybrid"),
|
| 661 |
+
visible(method == "hybrid"),
|
| 662 |
+
hoplength_show(method, hybrid),
|
| 663 |
+
],
|
| 664 |
+
inputs=[method, hybrid_method],
|
| 665 |
+
outputs=[hybrid_method, alpha, hop_length],
|
| 666 |
+
)
|
| 667 |
with gr.Row():
|
| 668 |
+
hybrid_method.change(
|
| 669 |
+
fn=hoplength_show, inputs=[method, hybrid_method], outputs=[hop_length]
|
| 670 |
+
)
|
| 671 |
+
refresh.click(
|
| 672 |
+
fn=change_models_choices, inputs=[], outputs=[model_pth, model_index]
|
| 673 |
+
)
|
| 674 |
model_pth.change(fn=get_index, inputs=[model_pth], outputs=[model_index])
|
| 675 |
with gr.Row():
|
| 676 |
+
input0.upload(
|
| 677 |
+
fn=lambda audio_in: [
|
| 678 |
+
shutil_move(audio.name, configs["audios_path"]) for audio in audio_in
|
| 679 |
+
][0],
|
| 680 |
+
inputs=[input0],
|
| 681 |
+
outputs=[input_audio0],
|
| 682 |
+
)
|
| 683 |
+
input_audio0.change(
|
| 684 |
+
fn=lambda audio: audio if os.path.isfile(audio) else None,
|
| 685 |
+
inputs=[input_audio0],
|
| 686 |
+
outputs=[play_audio],
|
| 687 |
+
)
|
| 688 |
+
formant_shifting.change(
|
| 689 |
+
fn=lambda a: [visible(a) for _ in range(2)],
|
| 690 |
+
inputs=[formant_shifting],
|
| 691 |
+
outputs=[formant_qfrency, formant_timbre],
|
| 692 |
+
)
|
| 693 |
with gr.Row():
|
| 694 |
+
embedders.change(
|
| 695 |
+
fn=lambda embedders: visible(embedders == "custom"),
|
| 696 |
+
inputs=[embedders],
|
| 697 |
+
outputs=[custom_embedders],
|
| 698 |
+
)
|
| 699 |
+
refresh0.click(
|
| 700 |
+
fn=change_audios_choices, inputs=[input_audio0], outputs=[input_audio0]
|
| 701 |
+
)
|
| 702 |
+
model_index.change(
|
| 703 |
+
fn=index_strength_show, inputs=[model_index], outputs=[index_strength]
|
| 704 |
+
)
|
| 705 |
with gr.Row():
|
| 706 |
+
convert_button.click(
|
| 707 |
+
fn=lambda: visible(False), inputs=[], outputs=[convert_button]
|
| 708 |
+
)
|
| 709 |
+
convert_button_2.click(
|
| 710 |
+
fn=lambda: [visible(False), visible(False)],
|
| 711 |
+
inputs=[],
|
| 712 |
+
outputs=[audio_select, convert_button_2],
|
| 713 |
+
)
|
| 714 |
with gr.Row():
|
| 715 |
+
proposal_pitch.change(
|
| 716 |
+
fn=visible, inputs=[proposal_pitch], outputs=[proposal_pitch_threshold]
|
| 717 |
+
)
|
| 718 |
+
embed_mode.change(
|
| 719 |
+
fn=change_embedders_mode, inputs=[embed_mode], outputs=[embedders]
|
| 720 |
+
)
|
| 721 |
with gr.Row():
|
| 722 |
convert_button.click(
|
| 723 |
fn=convert_selection,
|
|
|
|
| 750 |
f0_autotune_strength,
|
| 751 |
checkpointing,
|
| 752 |
onnx_f0_mode,
|
| 753 |
+
formant_shifting,
|
| 754 |
+
formant_qfrency,
|
| 755 |
formant_timbre,
|
| 756 |
f0_file_dropdown,
|
| 757 |
embed_mode,
|
| 758 |
proposal_pitch,
|
| 759 |
proposal_pitch_threshold,
|
| 760 |
audio_processing,
|
| 761 |
+
alpha,
|
| 762 |
],
|
| 763 |
+
outputs=[
|
| 764 |
+
audio_select,
|
| 765 |
+
main_convert,
|
| 766 |
+
backing_convert,
|
| 767 |
+
main_backing,
|
| 768 |
+
original_convert,
|
| 769 |
+
vocal_instrument,
|
| 770 |
+
convert_button,
|
| 771 |
+
convert_button_2,
|
| 772 |
+
],
|
| 773 |
+
api_name="convert_selection",
|
| 774 |
)
|
| 775 |
convert_button_2.click(
|
| 776 |
fn=convert_audio,
|
|
|
|
| 804 |
audio_select,
|
| 805 |
checkpointing,
|
| 806 |
onnx_f0_mode,
|
| 807 |
+
formant_shifting,
|
| 808 |
+
formant_qfrency,
|
| 809 |
formant_timbre,
|
| 810 |
f0_file_dropdown,
|
| 811 |
embed_mode,
|
| 812 |
proposal_pitch,
|
| 813 |
proposal_pitch_threshold,
|
| 814 |
audio_processing,
|
| 815 |
+
alpha,
|
| 816 |
],
|
| 817 |
+
outputs=[
|
| 818 |
+
main_convert,
|
| 819 |
+
backing_convert,
|
| 820 |
+
main_backing,
|
| 821 |
+
original_convert,
|
| 822 |
+
vocal_instrument,
|
| 823 |
+
convert_button,
|
| 824 |
+
],
|
| 825 |
+
api_name="convert_audio",
|
| 826 |
+
)
|
main/app/tabs/inference/child/convert_tts.py
CHANGED
|
@@ -34,7 +34,7 @@ def convert_tts_tab():
|
|
| 34 |
txt_input = gr.File(label=translations["drop_text"], file_types=[".txt", ".srt", ".docx"], visible=use_txt.value)
|
| 35 |
tts_voice = gr.Dropdown(label=translations["voice"], choices=edgetts, interactive=True, value="vi-VN-NamMinhNeural")
|
| 36 |
tts_pitch = gr.Slider(minimum=-20, maximum=20, step=1, info=translations["pitch_info_2"], label=translations["pitch"], value=0, interactive=True)
|
| 37 |
-
with gr.Accordion(translations["translate"], open=
|
| 38 |
with gr.Row():
|
| 39 |
source_lang = gr.Dropdown(label=translations["source_lang"], choices=["auto"]+google_tts_voice, interactive=True, value="auto")
|
| 40 |
target_lang = gr.Dropdown(label=translations["target_lang"], choices=google_tts_voice, interactive=True, value="en")
|
|
@@ -48,12 +48,12 @@ def convert_tts_tab():
|
|
| 48 |
refresh1 = gr.Button(translations["refresh"])
|
| 49 |
with gr.Row():
|
| 50 |
index_strength0 = gr.Slider(label=translations["index_strength"], info=translations["index_strength_info"], minimum=0, maximum=1, value=0.5, step=0.01, interactive=True, visible=model_index0.value != "")
|
| 51 |
-
with gr.Accordion(translations["output_path"], open=
|
| 52 |
export_format0 = gr.Radio(label=translations["export_format"], info=translations["export_info"], choices=export_format_choices, value="wav", interactive=True)
|
| 53 |
output_audio0 = gr.Textbox(label=translations["output_tts"], value="audios/tts.wav", placeholder="audios/tts.wav", info=translations["tts_output"], interactive=True)
|
| 54 |
output_audio1 = gr.Textbox(label=translations["output_tts_convert"], value="audios/tts-convert.wav", placeholder="audios/tts-convert.wav", info=translations["tts_output"], interactive=True)
|
| 55 |
-
with gr.Accordion(translations["setting"], open=
|
| 56 |
-
with gr.Accordion(translations["f0_method"], open=
|
| 57 |
with gr.Group():
|
| 58 |
with gr.Row():
|
| 59 |
onnx_f0_mode1 = gr.Checkbox(label=translations["f0_onnx_mode"], info=translations["f0_onnx_mode_info"], value=False, interactive=True)
|
|
@@ -62,21 +62,21 @@ def convert_tts_tab():
|
|
| 62 |
hybrid_method0 = gr.Dropdown(label=translations["f0_method_hybrid"], info=translations["f0_method_hybrid_info"], choices=hybrid_f0_method, value=hybrid_f0_method[0], interactive=True, allow_custom_value=True, visible=method0.value == "hybrid")
|
| 63 |
hop_length0 = gr.Slider(label=translations['hop_length'], info=translations["hop_length_info"], minimum=64, maximum=512, value=160, step=1, interactive=True, visible=False)
|
| 64 |
alpha = gr.Slider(label=translations["alpha_label"], info=translations["alpha_info"], minimum=0.1, maximum=1, value=0.5, step=0.1, interactive=True, visible=False)
|
| 65 |
-
with gr.Accordion(translations["f0_file"], open=
|
| 66 |
upload_f0_file0 = gr.File(label=translations["upload_f0"], file_types=[".txt"])
|
| 67 |
f0_file_dropdown0 = gr.Dropdown(label=translations["f0_file_2"], value="", choices=f0_file, allow_custom_value=True, interactive=True)
|
| 68 |
refresh_f0_file0 = gr.Button(translations["refresh"])
|
| 69 |
-
with gr.Accordion(translations["hubert_model"], open=
|
| 70 |
embed_mode1 = gr.Radio(label=translations["embed_mode"], info=translations["embed_mode_info"], value="fairseq", choices=embedders_mode, interactive=True, visible=True)
|
| 71 |
embedders0 = gr.Radio(label=translations["hubert_model"], info=translations["hubert_info"], choices=embedders_model, value="hubert_base", interactive=True)
|
| 72 |
custom_embedders0 = gr.Textbox(label=translations["modelname"], info=translations["modelname_info"], value="", placeholder="hubert_base", interactive=True, visible=embedders0.value == "custom")
|
| 73 |
-
with gr.Accordion(translations["use_presets"], open=
|
| 74 |
with gr.Row():
|
| 75 |
presets_name = gr.Dropdown(label=translations["file_preset"], choices=presets_file, value=presets_file[0] if len(presets_file) > 0 else '', interactive=True, allow_custom_value=True)
|
| 76 |
with gr.Row():
|
| 77 |
load_click = gr.Button(translations["load_file"], variant="primary")
|
| 78 |
refresh_click = gr.Button(translations["refresh"])
|
| 79 |
-
with gr.Accordion(translations["export_file"], open=
|
| 80 |
with gr.Row():
|
| 81 |
with gr.Column():
|
| 82 |
with gr.Group():
|
|
@@ -277,4 +277,4 @@ def convert_tts_tab():
|
|
| 277 |
],
|
| 278 |
outputs=[tts_voice_convert],
|
| 279 |
api_name="convert_tts"
|
| 280 |
-
)
|
|
|
|
| 34 |
txt_input = gr.File(label=translations["drop_text"], file_types=[".txt", ".srt", ".docx"], visible=use_txt.value)
|
| 35 |
tts_voice = gr.Dropdown(label=translations["voice"], choices=edgetts, interactive=True, value="vi-VN-NamMinhNeural")
|
| 36 |
tts_pitch = gr.Slider(minimum=-20, maximum=20, step=1, info=translations["pitch_info_2"], label=translations["pitch"], value=0, interactive=True)
|
| 37 |
+
with gr.Accordion(translations["translate"], open=True):
|
| 38 |
with gr.Row():
|
| 39 |
source_lang = gr.Dropdown(label=translations["source_lang"], choices=["auto"]+google_tts_voice, interactive=True, value="auto")
|
| 40 |
target_lang = gr.Dropdown(label=translations["target_lang"], choices=google_tts_voice, interactive=True, value="en")
|
|
|
|
| 48 |
refresh1 = gr.Button(translations["refresh"])
|
| 49 |
with gr.Row():
|
| 50 |
index_strength0 = gr.Slider(label=translations["index_strength"], info=translations["index_strength_info"], minimum=0, maximum=1, value=0.5, step=0.01, interactive=True, visible=model_index0.value != "")
|
| 51 |
+
with gr.Accordion(translations["output_path"], open=True):
|
| 52 |
export_format0 = gr.Radio(label=translations["export_format"], info=translations["export_info"], choices=export_format_choices, value="wav", interactive=True)
|
| 53 |
output_audio0 = gr.Textbox(label=translations["output_tts"], value="audios/tts.wav", placeholder="audios/tts.wav", info=translations["tts_output"], interactive=True)
|
| 54 |
output_audio1 = gr.Textbox(label=translations["output_tts_convert"], value="audios/tts-convert.wav", placeholder="audios/tts-convert.wav", info=translations["tts_output"], interactive=True)
|
| 55 |
+
with gr.Accordion(translations["setting"], open=True):
|
| 56 |
+
with gr.Accordion(translations["f0_method"], open=True):
|
| 57 |
with gr.Group():
|
| 58 |
with gr.Row():
|
| 59 |
onnx_f0_mode1 = gr.Checkbox(label=translations["f0_onnx_mode"], info=translations["f0_onnx_mode_info"], value=False, interactive=True)
|
|
|
|
| 62 |
hybrid_method0 = gr.Dropdown(label=translations["f0_method_hybrid"], info=translations["f0_method_hybrid_info"], choices=hybrid_f0_method, value=hybrid_f0_method[0], interactive=True, allow_custom_value=True, visible=method0.value == "hybrid")
|
| 63 |
hop_length0 = gr.Slider(label=translations['hop_length'], info=translations["hop_length_info"], minimum=64, maximum=512, value=160, step=1, interactive=True, visible=False)
|
| 64 |
alpha = gr.Slider(label=translations["alpha_label"], info=translations["alpha_info"], minimum=0.1, maximum=1, value=0.5, step=0.1, interactive=True, visible=False)
|
| 65 |
+
with gr.Accordion(translations["f0_file"], open=True):
|
| 66 |
upload_f0_file0 = gr.File(label=translations["upload_f0"], file_types=[".txt"])
|
| 67 |
f0_file_dropdown0 = gr.Dropdown(label=translations["f0_file_2"], value="", choices=f0_file, allow_custom_value=True, interactive=True)
|
| 68 |
refresh_f0_file0 = gr.Button(translations["refresh"])
|
| 69 |
+
with gr.Accordion(translations["hubert_model"], open=True):
|
| 70 |
embed_mode1 = gr.Radio(label=translations["embed_mode"], info=translations["embed_mode_info"], value="fairseq", choices=embedders_mode, interactive=True, visible=True)
|
| 71 |
embedders0 = gr.Radio(label=translations["hubert_model"], info=translations["hubert_info"], choices=embedders_model, value="hubert_base", interactive=True)
|
| 72 |
custom_embedders0 = gr.Textbox(label=translations["modelname"], info=translations["modelname_info"], value="", placeholder="hubert_base", interactive=True, visible=embedders0.value == "custom")
|
| 73 |
+
with gr.Accordion(translations["use_presets"], open=True):
|
| 74 |
with gr.Row():
|
| 75 |
presets_name = gr.Dropdown(label=translations["file_preset"], choices=presets_file, value=presets_file[0] if len(presets_file) > 0 else '', interactive=True, allow_custom_value=True)
|
| 76 |
with gr.Row():
|
| 77 |
load_click = gr.Button(translations["load_file"], variant="primary")
|
| 78 |
refresh_click = gr.Button(translations["refresh"])
|
| 79 |
+
with gr.Accordion(translations["export_file"], open=True):
|
| 80 |
with gr.Row():
|
| 81 |
with gr.Column():
|
| 82 |
with gr.Group():
|
|
|
|
| 277 |
],
|
| 278 |
outputs=[tts_voice_convert],
|
| 279 |
api_name="convert_tts"
|
| 280 |
+
)
|
main/app/tabs/inference/child/convert_with_whisper.py
CHANGED
|
@@ -38,7 +38,7 @@ def convert_with_whisper_tab():
|
|
| 38 |
with gr.Row():
|
| 39 |
pitch3 = gr.Slider(minimum=-20, maximum=20, step=1, info=translations["pitch_info"], label=translations["pitch"], value=0, interactive=True)
|
| 40 |
index_strength2 = gr.Slider(label=translations["index_strength"], info=translations["index_strength_info"], minimum=0, maximum=1, value=0.5, step=0.01, interactive=True, visible=model_index2.value != "")
|
| 41 |
-
with gr.Accordion(translations["input_output"], open=
|
| 42 |
with gr.Column():
|
| 43 |
export_format2 = gr.Radio(label=translations["export_format"], info=translations["export_info"], choices=export_format_choices, value="wav", interactive=True)
|
| 44 |
input_audio1 = gr.Dropdown(label=translations["audio_path"], value="", choices=paths_for_files, info=translations["provide_audio"], allow_custom_value=True, interactive=True)
|
|
@@ -57,10 +57,10 @@ def convert_with_whisper_tab():
|
|
| 57 |
with gr.Row():
|
| 58 |
pitch4 = gr.Slider(minimum=-20, maximum=20, step=1, info=translations["pitch_info"], label=translations["pitch"], value=0, interactive=True)
|
| 59 |
index_strength3 = gr.Slider(label=translations["index_strength"], info=translations["index_strength_info"], minimum=0, maximum=1, value=0.5, step=0.01, interactive=True, visible=model_index3.value != "")
|
| 60 |
-
with gr.Accordion(translations["setting"], open=
|
| 61 |
with gr.Row():
|
| 62 |
model_size = gr.Radio(label=translations["model_size"], info=translations["model_size_info"], choices=whisper_model, value="medium", interactive=True)
|
| 63 |
-
with gr.Accordion(translations["f0_method"], open=
|
| 64 |
with gr.Group():
|
| 65 |
with gr.Row():
|
| 66 |
onnx_f0_mode4 = gr.Checkbox(label=translations["f0_onnx_mode"], info=translations["f0_onnx_mode_info"], value=False, interactive=True)
|
|
@@ -69,7 +69,7 @@ def convert_with_whisper_tab():
|
|
| 69 |
hybrid_method3 = gr.Dropdown(label=translations["f0_method_hybrid"], info=translations["f0_method_hybrid_info"], choices=hybrid_f0_method, value=hybrid_f0_method[0], interactive=True, allow_custom_value=True, visible=method3.value == "hybrid")
|
| 70 |
hop_length3 = gr.Slider(label=translations['hop_length'], info=translations["hop_length_info"], minimum=64, maximum=512, value=160, step=1, interactive=True, visible=False)
|
| 71 |
alpha = gr.Slider(label=translations["alpha_label"], info=translations["alpha_info"], minimum=0.1, maximum=1, value=0.5, step=0.1, interactive=True, visible=False)
|
| 72 |
-
with gr.Accordion(translations["hubert_model"], open=
|
| 73 |
embed_mode3 = gr.Radio(label=translations["embed_mode"], info=translations["embed_mode_info"], value="fairseq", choices=embedders_mode, interactive=True, visible=True)
|
| 74 |
embedders3 = gr.Radio(label=translations["hubert_model"], info=translations["hubert_info"], choices=embedders_model, value="hubert_base", interactive=True)
|
| 75 |
custom_embedders3 = gr.Textbox(label=translations["modelname"], info=translations["modelname_info"], value="", placeholder="hubert_base", interactive=True, visible=embedders3.value == "custom")
|
|
@@ -161,4 +161,4 @@ def convert_with_whisper_tab():
|
|
| 161 |
],
|
| 162 |
outputs=[play_audio3],
|
| 163 |
api_name="convert_with_whisper"
|
| 164 |
-
)
|
|
|
|
| 38 |
with gr.Row():
|
| 39 |
pitch3 = gr.Slider(minimum=-20, maximum=20, step=1, info=translations["pitch_info"], label=translations["pitch"], value=0, interactive=True)
|
| 40 |
index_strength2 = gr.Slider(label=translations["index_strength"], info=translations["index_strength_info"], minimum=0, maximum=1, value=0.5, step=0.01, interactive=True, visible=model_index2.value != "")
|
| 41 |
+
with gr.Accordion(translations["input_output"], open=True):
|
| 42 |
with gr.Column():
|
| 43 |
export_format2 = gr.Radio(label=translations["export_format"], info=translations["export_info"], choices=export_format_choices, value="wav", interactive=True)
|
| 44 |
input_audio1 = gr.Dropdown(label=translations["audio_path"], value="", choices=paths_for_files, info=translations["provide_audio"], allow_custom_value=True, interactive=True)
|
|
|
|
| 57 |
with gr.Row():
|
| 58 |
pitch4 = gr.Slider(minimum=-20, maximum=20, step=1, info=translations["pitch_info"], label=translations["pitch"], value=0, interactive=True)
|
| 59 |
index_strength3 = gr.Slider(label=translations["index_strength"], info=translations["index_strength_info"], minimum=0, maximum=1, value=0.5, step=0.01, interactive=True, visible=model_index3.value != "")
|
| 60 |
+
with gr.Accordion(translations["setting"], open=True):
|
| 61 |
with gr.Row():
|
| 62 |
model_size = gr.Radio(label=translations["model_size"], info=translations["model_size_info"], choices=whisper_model, value="medium", interactive=True)
|
| 63 |
+
with gr.Accordion(translations["f0_method"], open=True):
|
| 64 |
with gr.Group():
|
| 65 |
with gr.Row():
|
| 66 |
onnx_f0_mode4 = gr.Checkbox(label=translations["f0_onnx_mode"], info=translations["f0_onnx_mode_info"], value=False, interactive=True)
|
|
|
|
| 69 |
hybrid_method3 = gr.Dropdown(label=translations["f0_method_hybrid"], info=translations["f0_method_hybrid_info"], choices=hybrid_f0_method, value=hybrid_f0_method[0], interactive=True, allow_custom_value=True, visible=method3.value == "hybrid")
|
| 70 |
hop_length3 = gr.Slider(label=translations['hop_length'], info=translations["hop_length_info"], minimum=64, maximum=512, value=160, step=1, interactive=True, visible=False)
|
| 71 |
alpha = gr.Slider(label=translations["alpha_label"], info=translations["alpha_info"], minimum=0.1, maximum=1, value=0.5, step=0.1, interactive=True, visible=False)
|
| 72 |
+
with gr.Accordion(translations["hubert_model"], open=True):
|
| 73 |
embed_mode3 = gr.Radio(label=translations["embed_mode"], info=translations["embed_mode_info"], value="fairseq", choices=embedders_mode, interactive=True, visible=True)
|
| 74 |
embedders3 = gr.Radio(label=translations["hubert_model"], info=translations["hubert_info"], choices=embedders_model, value="hubert_base", interactive=True)
|
| 75 |
custom_embedders3 = gr.Textbox(label=translations["modelname"], info=translations["modelname_info"], value="", placeholder="hubert_base", interactive=True, visible=embedders3.value == "custom")
|
|
|
|
| 161 |
],
|
| 162 |
outputs=[play_audio3],
|
| 163 |
api_name="convert_with_whisper"
|
| 164 |
+
)
|
main/app/tabs/inference/child/separate.py
CHANGED
|
@@ -7,224 +7,498 @@ sys.path.append(os.getcwd())
|
|
| 7 |
|
| 8 |
from main.app.core.downloads import download_url
|
| 9 |
from main.app.core.separate import separate_music
|
| 10 |
-
from main.app.core.ui import
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
def separate_tab():
|
| 14 |
-
with gr.Row():
|
| 15 |
gr.Markdown(translations["4_part"])
|
| 16 |
with gr.Row():
|
| 17 |
with gr.Column():
|
| 18 |
with gr.Group():
|
| 19 |
with gr.Row():
|
| 20 |
-
enable_denoise = gr.Checkbox(
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
with gr.Row():
|
| 27 |
-
model_name = gr.Dropdown(
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
with gr.Row():
|
| 32 |
with gr.Column():
|
| 33 |
-
separate_button = gr.Button(
|
|
|
|
|
|
|
| 34 |
with gr.Row():
|
| 35 |
with gr.Column():
|
| 36 |
with gr.Group():
|
| 37 |
with gr.Row():
|
| 38 |
-
shifts = gr.Slider(
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
with gr.Row():
|
| 41 |
-
segments_size = gr.Slider(
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
download_button = gr.Button(translations["downloads"])
|
| 47 |
with gr.Column():
|
| 48 |
with gr.Group():
|
| 49 |
with gr.Row():
|
| 50 |
-
overlap = gr.Radio(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
with gr.Row():
|
| 52 |
-
window_size = gr.Slider(
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
refresh_audio = gr.Button(translations["refresh"])
|
| 60 |
-
output_dirs = gr.Textbox(
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
with gr.Row():
|
| 63 |
gr.Markdown(translations["output_separator"])
|
| 64 |
with gr.Row():
|
| 65 |
-
instruments_audio = gr.Audio(
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
with gr.Row():
|
| 70 |
-
model_name.change(
|
| 71 |
-
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
with gr.Row():
|
| 74 |
-
input_audio.change(
|
| 75 |
-
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
with gr.Row():
|
| 78 |
-
separate_backing.change(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
download_button.click(
|
| 80 |
-
fn=download_url,
|
| 81 |
-
inputs=[url],
|
| 82 |
outputs=[input_audio, audio_input, url],
|
| 83 |
-
api_name=
|
| 84 |
)
|
| 85 |
with gr.Row():
|
| 86 |
model_name.change(
|
| 87 |
fn=separate_change,
|
| 88 |
-
inputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
outputs=[
|
| 90 |
karaoke_model,
|
| 91 |
reverb_model,
|
| 92 |
-
overlap,
|
| 93 |
-
segments_size,
|
| 94 |
-
hop_length,
|
| 95 |
batch_size,
|
| 96 |
-
shifts,
|
| 97 |
-
window_size,
|
| 98 |
-
aggression,
|
| 99 |
post_process_threshold,
|
| 100 |
denoise_model,
|
| 101 |
-
enable_tta,
|
| 102 |
-
high_end_process,
|
| 103 |
enable_post_process,
|
| 104 |
-
]
|
| 105 |
)
|
| 106 |
with gr.Row():
|
| 107 |
karaoke_model.change(
|
| 108 |
-
fn=separate_change,
|
| 109 |
-
inputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
outputs=[
|
| 111 |
karaoke_model,
|
| 112 |
reverb_model,
|
| 113 |
-
overlap,
|
| 114 |
-
segments_size,
|
| 115 |
-
hop_length,
|
| 116 |
batch_size,
|
| 117 |
-
shifts,
|
| 118 |
-
window_size,
|
| 119 |
-
aggression,
|
| 120 |
post_process_threshold,
|
| 121 |
denoise_model,
|
| 122 |
-
enable_tta,
|
| 123 |
-
high_end_process,
|
| 124 |
enable_post_process,
|
| 125 |
-
]
|
| 126 |
)
|
| 127 |
separate_backing.change(
|
| 128 |
-
fn=separate_change,
|
| 129 |
-
inputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
outputs=[
|
| 131 |
karaoke_model,
|
| 132 |
reverb_model,
|
| 133 |
-
overlap,
|
| 134 |
-
segments_size,
|
| 135 |
-
hop_length,
|
| 136 |
batch_size,
|
| 137 |
-
shifts,
|
| 138 |
-
window_size,
|
| 139 |
-
aggression,
|
| 140 |
post_process_threshold,
|
| 141 |
denoise_model,
|
| 142 |
-
enable_tta,
|
| 143 |
-
high_end_process,
|
| 144 |
enable_post_process,
|
| 145 |
-
]
|
| 146 |
)
|
| 147 |
with gr.Row():
|
| 148 |
reverb_model.change(
|
| 149 |
-
fn=separate_change,
|
| 150 |
-
inputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
outputs=[
|
| 152 |
karaoke_model,
|
| 153 |
reverb_model,
|
| 154 |
-
overlap,
|
| 155 |
-
segments_size,
|
| 156 |
-
hop_length,
|
| 157 |
batch_size,
|
| 158 |
-
shifts,
|
| 159 |
-
window_size,
|
| 160 |
-
aggression,
|
| 161 |
post_process_threshold,
|
| 162 |
denoise_model,
|
| 163 |
-
enable_tta,
|
| 164 |
-
high_end_process,
|
| 165 |
enable_post_process,
|
| 166 |
-
]
|
| 167 |
)
|
| 168 |
separate_reverb.change(
|
| 169 |
-
fn=separate_change,
|
| 170 |
-
inputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
outputs=[
|
| 172 |
karaoke_model,
|
| 173 |
reverb_model,
|
| 174 |
-
overlap,
|
| 175 |
-
segments_size,
|
| 176 |
-
hop_length,
|
| 177 |
batch_size,
|
| 178 |
-
shifts,
|
| 179 |
-
window_size,
|
| 180 |
-
aggression,
|
| 181 |
post_process_threshold,
|
| 182 |
denoise_model,
|
| 183 |
-
enable_tta,
|
| 184 |
-
high_end_process,
|
| 185 |
enable_post_process,
|
| 186 |
-
]
|
| 187 |
)
|
| 188 |
with gr.Row():
|
| 189 |
enable_denoise.change(
|
| 190 |
-
fn=separate_change,
|
| 191 |
-
inputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
outputs=[
|
| 193 |
karaoke_model,
|
| 194 |
reverb_model,
|
| 195 |
-
overlap,
|
| 196 |
-
segments_size,
|
| 197 |
-
hop_length,
|
| 198 |
batch_size,
|
| 199 |
-
shifts,
|
| 200 |
-
window_size,
|
| 201 |
-
aggression,
|
| 202 |
post_process_threshold,
|
| 203 |
denoise_model,
|
| 204 |
-
enable_tta,
|
| 205 |
-
high_end_process,
|
| 206 |
enable_post_process,
|
| 207 |
-
]
|
| 208 |
)
|
| 209 |
enable_post_process.change(
|
| 210 |
-
fn=separate_change,
|
| 211 |
-
inputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
outputs=[
|
| 213 |
karaoke_model,
|
| 214 |
reverb_model,
|
| 215 |
-
overlap,
|
| 216 |
-
segments_size,
|
| 217 |
-
hop_length,
|
| 218 |
batch_size,
|
| 219 |
-
shifts,
|
| 220 |
-
window_size,
|
| 221 |
-
aggression,
|
| 222 |
post_process_threshold,
|
| 223 |
denoise_model,
|
| 224 |
-
enable_tta,
|
| 225 |
-
high_end_process,
|
| 226 |
enable_post_process,
|
| 227 |
-
]
|
| 228 |
)
|
| 229 |
with gr.Row():
|
| 230 |
separate_button.click(
|
|
@@ -232,32 +506,27 @@ def separate_tab():
|
|
| 232 |
inputs=[
|
| 233 |
input_audio,
|
| 234 |
output_dirs,
|
| 235 |
-
export_format,
|
| 236 |
-
model_name,
|
| 237 |
karaoke_model,
|
| 238 |
reverb_model,
|
| 239 |
denoise_model,
|
| 240 |
sample_rate,
|
| 241 |
-
shifts,
|
| 242 |
-
batch_size,
|
| 243 |
-
overlap,
|
| 244 |
aggression,
|
| 245 |
-
hop_length,
|
| 246 |
window_size,
|
| 247 |
-
segments_size,
|
| 248 |
post_process_threshold,
|
| 249 |
enable_tta,
|
| 250 |
-
enable_denoise,
|
| 251 |
high_end_process,
|
| 252 |
enable_post_process,
|
| 253 |
separate_backing,
|
| 254 |
-
separate_reverb
|
| 255 |
],
|
| 256 |
-
outputs=[
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
main_vocals,
|
| 260 |
-
backing_vocals
|
| 261 |
-
],
|
| 262 |
-
api_name="separate_music"
|
| 263 |
-
)
|
|
|
|
| 7 |
|
| 8 |
from main.app.core.downloads import download_url
|
| 9 |
from main.app.core.separate import separate_music
|
| 10 |
+
from main.app.core.ui import (
|
| 11 |
+
visible,
|
| 12 |
+
valueFalse_interactive,
|
| 13 |
+
change_audios_choices,
|
| 14 |
+
shutil_move,
|
| 15 |
+
separate_change,
|
| 16 |
+
)
|
| 17 |
+
from main.app.variables import (
|
| 18 |
+
translations,
|
| 19 |
+
uvr_model,
|
| 20 |
+
karaoke_models,
|
| 21 |
+
reverb_models,
|
| 22 |
+
vr_models,
|
| 23 |
+
denoise_models,
|
| 24 |
+
mdx_models,
|
| 25 |
+
paths_for_files,
|
| 26 |
+
sample_rate_choice,
|
| 27 |
+
configs,
|
| 28 |
+
file_types,
|
| 29 |
+
export_format_choices,
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
|
| 33 |
def separate_tab():
|
| 34 |
+
with gr.Row():
|
| 35 |
gr.Markdown(translations["4_part"])
|
| 36 |
with gr.Row():
|
| 37 |
with gr.Column():
|
| 38 |
with gr.Group():
|
| 39 |
with gr.Row():
|
| 40 |
+
enable_denoise = gr.Checkbox(
|
| 41 |
+
label=translations["denoise_mdx"],
|
| 42 |
+
value=False,
|
| 43 |
+
interactive=False,
|
| 44 |
+
)
|
| 45 |
+
separate_backing = gr.Checkbox(
|
| 46 |
+
label=translations["separator_backing"],
|
| 47 |
+
value=False,
|
| 48 |
+
interactive=True,
|
| 49 |
+
)
|
| 50 |
+
separate_reverb = gr.Checkbox(
|
| 51 |
+
label=translations["dereveb_audio"],
|
| 52 |
+
value=False,
|
| 53 |
+
interactive=True,
|
| 54 |
+
)
|
| 55 |
+
enable_tta = gr.Checkbox(
|
| 56 |
+
label=translations["enable_tta"], value=False, interactive=False
|
| 57 |
+
)
|
| 58 |
+
high_end_process = gr.Checkbox(
|
| 59 |
+
label=translations["high_end_process"],
|
| 60 |
+
value=False,
|
| 61 |
+
interactive=False,
|
| 62 |
+
)
|
| 63 |
+
enable_post_process = gr.Checkbox(
|
| 64 |
+
label=translations["enable_post_process"],
|
| 65 |
+
value=False,
|
| 66 |
+
interactive=False,
|
| 67 |
+
)
|
| 68 |
with gr.Row():
|
| 69 |
+
model_name = gr.Dropdown(
|
| 70 |
+
label=translations["separator_model"],
|
| 71 |
+
value=uvr_model[0],
|
| 72 |
+
choices=uvr_model,
|
| 73 |
+
interactive=True,
|
| 74 |
+
)
|
| 75 |
+
karaoke_model = gr.Dropdown(
|
| 76 |
+
label=translations["separator_backing_model"],
|
| 77 |
+
value=list(karaoke_models.keys())[0],
|
| 78 |
+
choices=list(karaoke_models.keys()),
|
| 79 |
+
interactive=True,
|
| 80 |
+
visible=separate_backing.value,
|
| 81 |
+
)
|
| 82 |
+
reverb_model = gr.Dropdown(
|
| 83 |
+
label=translations["dereveb_model"],
|
| 84 |
+
value=list(reverb_models.keys())[0],
|
| 85 |
+
choices=list(reverb_models.keys()),
|
| 86 |
+
interactive=True,
|
| 87 |
+
visible=separate_reverb.value,
|
| 88 |
+
)
|
| 89 |
+
denoise_model = gr.Dropdown(
|
| 90 |
+
label=translations["denoise_model"],
|
| 91 |
+
value=list(denoise_models.keys())[0],
|
| 92 |
+
choices=list(denoise_models.keys()),
|
| 93 |
+
interactive=True,
|
| 94 |
+
visible=enable_denoise.value
|
| 95 |
+
and model_name.value in list(vr_models.keys()),
|
| 96 |
+
)
|
| 97 |
with gr.Row():
|
| 98 |
with gr.Column():
|
| 99 |
+
separate_button = gr.Button(
|
| 100 |
+
translations["separator_tab"], variant="primary"
|
| 101 |
+
)
|
| 102 |
with gr.Row():
|
| 103 |
with gr.Column():
|
| 104 |
with gr.Group():
|
| 105 |
with gr.Row():
|
| 106 |
+
shifts = gr.Slider(
|
| 107 |
+
label=translations["shift"],
|
| 108 |
+
info=translations["shift_info"],
|
| 109 |
+
minimum=1,
|
| 110 |
+
maximum=20,
|
| 111 |
+
value=2,
|
| 112 |
+
step=1,
|
| 113 |
+
interactive=True,
|
| 114 |
+
)
|
| 115 |
+
batch_size = gr.Slider(
|
| 116 |
+
label=translations["batch_size"],
|
| 117 |
+
info=translations["mdx_batch_size_info"],
|
| 118 |
+
minimum=1,
|
| 119 |
+
maximum=64,
|
| 120 |
+
value=1,
|
| 121 |
+
step=1,
|
| 122 |
+
interactive=True,
|
| 123 |
+
visible=False,
|
| 124 |
+
)
|
| 125 |
with gr.Row():
|
| 126 |
+
segments_size = gr.Slider(
|
| 127 |
+
label=translations["segments_size"],
|
| 128 |
+
info=translations["segments_size_info"],
|
| 129 |
+
minimum=32,
|
| 130 |
+
maximum=3072,
|
| 131 |
+
value=256,
|
| 132 |
+
step=32,
|
| 133 |
+
interactive=True,
|
| 134 |
+
)
|
| 135 |
+
aggression = gr.Slider(
|
| 136 |
+
label=translations["aggression"],
|
| 137 |
+
info=translations["aggression_info"],
|
| 138 |
+
minimum=1,
|
| 139 |
+
maximum=50,
|
| 140 |
+
value=5,
|
| 141 |
+
step=1,
|
| 142 |
+
interactive=True,
|
| 143 |
+
visible=False,
|
| 144 |
+
)
|
| 145 |
+
drop_audio = gr.Files(
|
| 146 |
+
label=translations["drop_audio"], file_types=file_types
|
| 147 |
+
)
|
| 148 |
+
with gr.Accordion(translations["use_url"], open=True):
|
| 149 |
+
url = gr.Textbox(
|
| 150 |
+
label=translations["url_audio"],
|
| 151 |
+
value="",
|
| 152 |
+
placeholder="https://www.youtube.com/...",
|
| 153 |
+
scale=6,
|
| 154 |
+
)
|
| 155 |
download_button = gr.Button(translations["downloads"])
|
| 156 |
with gr.Column():
|
| 157 |
with gr.Group():
|
| 158 |
with gr.Row():
|
| 159 |
+
overlap = gr.Radio(
|
| 160 |
+
label=translations["overlap"],
|
| 161 |
+
info=translations["overlap_info"],
|
| 162 |
+
choices=["0.25", "0.5", "0.75", "0.99"],
|
| 163 |
+
value="0.25",
|
| 164 |
+
interactive=True,
|
| 165 |
+
)
|
| 166 |
with gr.Row():
|
| 167 |
+
window_size = gr.Slider(
|
| 168 |
+
label=translations["window_size"],
|
| 169 |
+
info=translations["window_size_info"],
|
| 170 |
+
minimum=320,
|
| 171 |
+
maximum=1024,
|
| 172 |
+
value=512,
|
| 173 |
+
step=32,
|
| 174 |
+
interactive=True,
|
| 175 |
+
visible=False,
|
| 176 |
+
)
|
| 177 |
+
hop_length = gr.Slider(
|
| 178 |
+
label=translations["hop_length"],
|
| 179 |
+
info=translations["hop_length_info"],
|
| 180 |
+
minimum=64,
|
| 181 |
+
maximum=8192,
|
| 182 |
+
value=1024,
|
| 183 |
+
step=1,
|
| 184 |
+
interactive=True,
|
| 185 |
+
visible=False,
|
| 186 |
+
)
|
| 187 |
+
post_process_threshold = gr.Slider(
|
| 188 |
+
label=translations["post_process_threshold"],
|
| 189 |
+
info=translations["post_process_threshold_info"],
|
| 190 |
+
minimum=0.1,
|
| 191 |
+
maximum=0.3,
|
| 192 |
+
value=0.2,
|
| 193 |
+
step=0.1,
|
| 194 |
+
interactive=True,
|
| 195 |
+
visible=False,
|
| 196 |
+
)
|
| 197 |
+
sample_rate = gr.Radio(
|
| 198 |
+
choices=sample_rate_choice,
|
| 199 |
+
value=44100,
|
| 200 |
+
label=translations["sr"],
|
| 201 |
+
info=translations["sr_info"],
|
| 202 |
+
interactive=True,
|
| 203 |
+
)
|
| 204 |
+
with gr.Accordion(translations["input_output"], open=True):
|
| 205 |
+
export_format = gr.Radio(
|
| 206 |
+
label=translations["export_format"],
|
| 207 |
+
info=translations["export_info"],
|
| 208 |
+
choices=export_format_choices,
|
| 209 |
+
value="wav",
|
| 210 |
+
interactive=True,
|
| 211 |
+
)
|
| 212 |
+
input_audio = gr.Dropdown(
|
| 213 |
+
label=translations["audio_path"],
|
| 214 |
+
value="",
|
| 215 |
+
choices=paths_for_files,
|
| 216 |
+
allow_custom_value=True,
|
| 217 |
+
interactive=True,
|
| 218 |
+
)
|
| 219 |
refresh_audio = gr.Button(translations["refresh"])
|
| 220 |
+
output_dirs = gr.Textbox(
|
| 221 |
+
label=translations["output_folder"],
|
| 222 |
+
value="audios",
|
| 223 |
+
placeholder="audios",
|
| 224 |
+
info=translations["output_folder_info"],
|
| 225 |
+
interactive=True,
|
| 226 |
+
)
|
| 227 |
+
audio_input = gr.Audio(
|
| 228 |
+
show_download_button=True,
|
| 229 |
+
interactive=False,
|
| 230 |
+
label=translations["input_audio"],
|
| 231 |
+
)
|
| 232 |
with gr.Row():
|
| 233 |
gr.Markdown(translations["output_separator"])
|
| 234 |
with gr.Row():
|
| 235 |
+
instruments_audio = gr.Audio(
|
| 236 |
+
show_download_button=True,
|
| 237 |
+
interactive=False,
|
| 238 |
+
label=translations["instruments"],
|
| 239 |
+
)
|
| 240 |
+
original_vocals = gr.Audio(
|
| 241 |
+
show_download_button=True,
|
| 242 |
+
interactive=False,
|
| 243 |
+
label=translations["original_vocal"],
|
| 244 |
+
)
|
| 245 |
+
main_vocals = gr.Audio(
|
| 246 |
+
show_download_button=True,
|
| 247 |
+
interactive=False,
|
| 248 |
+
label=translations["main_vocal"],
|
| 249 |
+
visible=separate_backing.value,
|
| 250 |
+
)
|
| 251 |
+
backing_vocals = gr.Audio(
|
| 252 |
+
show_download_button=True,
|
| 253 |
+
interactive=False,
|
| 254 |
+
label=translations["backing_vocal"],
|
| 255 |
+
visible=separate_backing.value,
|
| 256 |
+
)
|
| 257 |
with gr.Row():
|
| 258 |
+
model_name.change(
|
| 259 |
+
fn=lambda a: valueFalse_interactive(
|
| 260 |
+
a in list(mdx_models.keys()) + list(vr_models.keys())
|
| 261 |
+
),
|
| 262 |
+
inputs=[model_name],
|
| 263 |
+
outputs=[enable_denoise],
|
| 264 |
+
)
|
| 265 |
+
separate_backing.change(
|
| 266 |
+
fn=lambda a, b: valueFalse_interactive(a or b),
|
| 267 |
+
inputs=[separate_backing, separate_reverb],
|
| 268 |
+
outputs=[enable_denoise],
|
| 269 |
+
)
|
| 270 |
+
separate_reverb.change(
|
| 271 |
+
fn=lambda a, b: valueFalse_interactive(a or b),
|
| 272 |
+
inputs=[separate_backing, separate_reverb],
|
| 273 |
+
outputs=[enable_denoise],
|
| 274 |
+
)
|
| 275 |
with gr.Row():
|
| 276 |
+
input_audio.change(
|
| 277 |
+
fn=lambda audio: audio if os.path.isfile(audio) else None,
|
| 278 |
+
inputs=[input_audio],
|
| 279 |
+
outputs=[audio_input],
|
| 280 |
+
)
|
| 281 |
+
drop_audio.upload(
|
| 282 |
+
fn=lambda audio_in: [
|
| 283 |
+
shutil_move(audio.name, configs["audios_path"]) for audio in audio_in
|
| 284 |
+
][0],
|
| 285 |
+
inputs=[drop_audio],
|
| 286 |
+
outputs=[input_audio],
|
| 287 |
+
)
|
| 288 |
+
refresh_audio.click(
|
| 289 |
+
fn=change_audios_choices, inputs=[input_audio], outputs=[input_audio]
|
| 290 |
+
)
|
| 291 |
with gr.Row():
|
| 292 |
+
separate_backing.change(
|
| 293 |
+
fn=lambda a: [visible(a) for _ in range(2)],
|
| 294 |
+
inputs=[separate_backing],
|
| 295 |
+
outputs=[main_vocals, backing_vocals],
|
| 296 |
+
)
|
| 297 |
download_button.click(
|
| 298 |
+
fn=download_url,
|
| 299 |
+
inputs=[url],
|
| 300 |
outputs=[input_audio, audio_input, url],
|
| 301 |
+
api_name="download_url",
|
| 302 |
)
|
| 303 |
with gr.Row():
|
| 304 |
model_name.change(
|
| 305 |
fn=separate_change,
|
| 306 |
+
inputs=[
|
| 307 |
+
model_name,
|
| 308 |
+
karaoke_model,
|
| 309 |
+
reverb_model,
|
| 310 |
+
enable_post_process,
|
| 311 |
+
separate_backing,
|
| 312 |
+
separate_reverb,
|
| 313 |
+
enable_denoise,
|
| 314 |
+
],
|
| 315 |
outputs=[
|
| 316 |
karaoke_model,
|
| 317 |
reverb_model,
|
| 318 |
+
overlap,
|
| 319 |
+
segments_size,
|
| 320 |
+
hop_length,
|
| 321 |
batch_size,
|
| 322 |
+
shifts,
|
| 323 |
+
window_size,
|
| 324 |
+
aggression,
|
| 325 |
post_process_threshold,
|
| 326 |
denoise_model,
|
| 327 |
+
enable_tta,
|
| 328 |
+
high_end_process,
|
| 329 |
enable_post_process,
|
| 330 |
+
],
|
| 331 |
)
|
| 332 |
with gr.Row():
|
| 333 |
karaoke_model.change(
|
| 334 |
+
fn=separate_change,
|
| 335 |
+
inputs=[
|
| 336 |
+
model_name,
|
| 337 |
+
karaoke_model,
|
| 338 |
+
reverb_model,
|
| 339 |
+
enable_post_process,
|
| 340 |
+
separate_backing,
|
| 341 |
+
separate_reverb,
|
| 342 |
+
enable_denoise,
|
| 343 |
+
],
|
| 344 |
outputs=[
|
| 345 |
karaoke_model,
|
| 346 |
reverb_model,
|
| 347 |
+
overlap,
|
| 348 |
+
segments_size,
|
| 349 |
+
hop_length,
|
| 350 |
batch_size,
|
| 351 |
+
shifts,
|
| 352 |
+
window_size,
|
| 353 |
+
aggression,
|
| 354 |
post_process_threshold,
|
| 355 |
denoise_model,
|
| 356 |
+
enable_tta,
|
| 357 |
+
high_end_process,
|
| 358 |
enable_post_process,
|
| 359 |
+
],
|
| 360 |
)
|
| 361 |
separate_backing.change(
|
| 362 |
+
fn=separate_change,
|
| 363 |
+
inputs=[
|
| 364 |
+
model_name,
|
| 365 |
+
karaoke_model,
|
| 366 |
+
reverb_model,
|
| 367 |
+
enable_post_process,
|
| 368 |
+
separate_backing,
|
| 369 |
+
separate_reverb,
|
| 370 |
+
enable_denoise,
|
| 371 |
+
],
|
| 372 |
outputs=[
|
| 373 |
karaoke_model,
|
| 374 |
reverb_model,
|
| 375 |
+
overlap,
|
| 376 |
+
segments_size,
|
| 377 |
+
hop_length,
|
| 378 |
batch_size,
|
| 379 |
+
shifts,
|
| 380 |
+
window_size,
|
| 381 |
+
aggression,
|
| 382 |
post_process_threshold,
|
| 383 |
denoise_model,
|
| 384 |
+
enable_tta,
|
| 385 |
+
high_end_process,
|
| 386 |
enable_post_process,
|
| 387 |
+
],
|
| 388 |
)
|
| 389 |
with gr.Row():
|
| 390 |
reverb_model.change(
|
| 391 |
+
fn=separate_change,
|
| 392 |
+
inputs=[
|
| 393 |
+
model_name,
|
| 394 |
+
karaoke_model,
|
| 395 |
+
reverb_model,
|
| 396 |
+
enable_post_process,
|
| 397 |
+
separate_backing,
|
| 398 |
+
separate_reverb,
|
| 399 |
+
enable_denoise,
|
| 400 |
+
],
|
| 401 |
outputs=[
|
| 402 |
karaoke_model,
|
| 403 |
reverb_model,
|
| 404 |
+
overlap,
|
| 405 |
+
segments_size,
|
| 406 |
+
hop_length,
|
| 407 |
batch_size,
|
| 408 |
+
shifts,
|
| 409 |
+
window_size,
|
| 410 |
+
aggression,
|
| 411 |
post_process_threshold,
|
| 412 |
denoise_model,
|
| 413 |
+
enable_tta,
|
| 414 |
+
high_end_process,
|
| 415 |
enable_post_process,
|
| 416 |
+
],
|
| 417 |
)
|
| 418 |
separate_reverb.change(
|
| 419 |
+
fn=separate_change,
|
| 420 |
+
inputs=[
|
| 421 |
+
model_name,
|
| 422 |
+
karaoke_model,
|
| 423 |
+
reverb_model,
|
| 424 |
+
enable_post_process,
|
| 425 |
+
separate_backing,
|
| 426 |
+
separate_reverb,
|
| 427 |
+
enable_denoise,
|
| 428 |
+
],
|
| 429 |
outputs=[
|
| 430 |
karaoke_model,
|
| 431 |
reverb_model,
|
| 432 |
+
overlap,
|
| 433 |
+
segments_size,
|
| 434 |
+
hop_length,
|
| 435 |
batch_size,
|
| 436 |
+
shifts,
|
| 437 |
+
window_size,
|
| 438 |
+
aggression,
|
| 439 |
post_process_threshold,
|
| 440 |
denoise_model,
|
| 441 |
+
enable_tta,
|
| 442 |
+
high_end_process,
|
| 443 |
enable_post_process,
|
| 444 |
+
],
|
| 445 |
)
|
| 446 |
with gr.Row():
|
| 447 |
enable_denoise.change(
|
| 448 |
+
fn=separate_change,
|
| 449 |
+
inputs=[
|
| 450 |
+
model_name,
|
| 451 |
+
karaoke_model,
|
| 452 |
+
reverb_model,
|
| 453 |
+
enable_post_process,
|
| 454 |
+
separate_backing,
|
| 455 |
+
separate_reverb,
|
| 456 |
+
enable_denoise,
|
| 457 |
+
],
|
| 458 |
outputs=[
|
| 459 |
karaoke_model,
|
| 460 |
reverb_model,
|
| 461 |
+
overlap,
|
| 462 |
+
segments_size,
|
| 463 |
+
hop_length,
|
| 464 |
batch_size,
|
| 465 |
+
shifts,
|
| 466 |
+
window_size,
|
| 467 |
+
aggression,
|
| 468 |
post_process_threshold,
|
| 469 |
denoise_model,
|
| 470 |
+
enable_tta,
|
| 471 |
+
high_end_process,
|
| 472 |
enable_post_process,
|
| 473 |
+
],
|
| 474 |
)
|
| 475 |
enable_post_process.change(
|
| 476 |
+
fn=separate_change,
|
| 477 |
+
inputs=[
|
| 478 |
+
model_name,
|
| 479 |
+
karaoke_model,
|
| 480 |
+
reverb_model,
|
| 481 |
+
enable_post_process,
|
| 482 |
+
separate_backing,
|
| 483 |
+
separate_reverb,
|
| 484 |
+
enable_denoise,
|
| 485 |
+
],
|
| 486 |
outputs=[
|
| 487 |
karaoke_model,
|
| 488 |
reverb_model,
|
| 489 |
+
overlap,
|
| 490 |
+
segments_size,
|
| 491 |
+
hop_length,
|
| 492 |
batch_size,
|
| 493 |
+
shifts,
|
| 494 |
+
window_size,
|
| 495 |
+
aggression,
|
| 496 |
post_process_threshold,
|
| 497 |
denoise_model,
|
| 498 |
+
enable_tta,
|
| 499 |
+
high_end_process,
|
| 500 |
enable_post_process,
|
| 501 |
+
],
|
| 502 |
)
|
| 503 |
with gr.Row():
|
| 504 |
separate_button.click(
|
|
|
|
| 506 |
inputs=[
|
| 507 |
input_audio,
|
| 508 |
output_dirs,
|
| 509 |
+
export_format,
|
| 510 |
+
model_name,
|
| 511 |
karaoke_model,
|
| 512 |
reverb_model,
|
| 513 |
denoise_model,
|
| 514 |
sample_rate,
|
| 515 |
+
shifts,
|
| 516 |
+
batch_size,
|
| 517 |
+
overlap,
|
| 518 |
aggression,
|
| 519 |
+
hop_length,
|
| 520 |
window_size,
|
| 521 |
+
segments_size,
|
| 522 |
post_process_threshold,
|
| 523 |
enable_tta,
|
| 524 |
+
enable_denoise,
|
| 525 |
high_end_process,
|
| 526 |
enable_post_process,
|
| 527 |
separate_backing,
|
| 528 |
+
separate_reverb,
|
| 529 |
],
|
| 530 |
+
outputs=[original_vocals, instruments_audio, main_vocals, backing_vocals],
|
| 531 |
+
api_name="separate_music",
|
| 532 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
main/app/tabs/training/child/create_reference.py
CHANGED
|
@@ -27,7 +27,7 @@ def create_reference_tab():
|
|
| 27 |
f0_autotune_strength = gr.Slider(minimum=0, maximum=1, label=translations["autotune_rate"], info=translations["autotune_rate_info"], value=1, step=0.1, interactive=True, visible=f0_autotune.value)
|
| 28 |
with gr.Row():
|
| 29 |
with gr.Column():
|
| 30 |
-
with gr.Accordion(translations["input_output"], open=
|
| 31 |
with gr.Column():
|
| 32 |
input_audio = gr.Dropdown(label=translations["audio_path"], value="", choices=paths_for_files, info=translations["provide_audio"], allow_custom_value=True, interactive=True)
|
| 33 |
reference_name = gr.Textbox(label=translations["reference_name"], value="reference", placeholder="reference", info=translations["reference_name_info"], interactive=True)
|
|
@@ -38,7 +38,7 @@ def create_reference_tab():
|
|
| 38 |
with gr.Column():
|
| 39 |
play_audio = gr.Audio(show_download_button=True, interactive=False, label=translations["input_audio"])
|
| 40 |
with gr.Column() as f0_method_column:
|
| 41 |
-
with gr.Accordion(label=translations["f0_method"], open=
|
| 42 |
with gr.Group():
|
| 43 |
with gr.Row():
|
| 44 |
onnx_f0 = gr.Checkbox(label=translations["f0_onnx_mode"], value=False, interactive=True)
|
|
@@ -48,7 +48,7 @@ def create_reference_tab():
|
|
| 48 |
with gr.Row():
|
| 49 |
alpha = gr.Slider(label=translations["alpha_label"], info=translations["alpha_info"], minimum=0.1, maximum=1, value=0.5, step=0.1, interactive=True, visible=False)
|
| 50 |
with gr.Column():
|
| 51 |
-
with gr.Accordion(label=translations["hubert_model"], open=
|
| 52 |
with gr.Row():
|
| 53 |
version = gr.Radio(label=translations["training_version"], info=translations["training_version_info"], choices=["v1", "v2"], value="v2", interactive=True)
|
| 54 |
with gr.Group():
|
|
@@ -94,4 +94,4 @@ def create_reference_tab():
|
|
| 94 |
],
|
| 95 |
outputs=[create_reference_info],
|
| 96 |
api_name="create_reference"
|
| 97 |
-
)
|
|
|
|
| 27 |
f0_autotune_strength = gr.Slider(minimum=0, maximum=1, label=translations["autotune_rate"], info=translations["autotune_rate_info"], value=1, step=0.1, interactive=True, visible=f0_autotune.value)
|
| 28 |
with gr.Row():
|
| 29 |
with gr.Column():
|
| 30 |
+
with gr.Accordion(translations["input_output"], open=True):
|
| 31 |
with gr.Column():
|
| 32 |
input_audio = gr.Dropdown(label=translations["audio_path"], value="", choices=paths_for_files, info=translations["provide_audio"], allow_custom_value=True, interactive=True)
|
| 33 |
reference_name = gr.Textbox(label=translations["reference_name"], value="reference", placeholder="reference", info=translations["reference_name_info"], interactive=True)
|
|
|
|
| 38 |
with gr.Column():
|
| 39 |
play_audio = gr.Audio(show_download_button=True, interactive=False, label=translations["input_audio"])
|
| 40 |
with gr.Column() as f0_method_column:
|
| 41 |
+
with gr.Accordion(label=translations["f0_method"], open=True):
|
| 42 |
with gr.Group():
|
| 43 |
with gr.Row():
|
| 44 |
onnx_f0 = gr.Checkbox(label=translations["f0_onnx_mode"], value=False, interactive=True)
|
|
|
|
| 48 |
with gr.Row():
|
| 49 |
alpha = gr.Slider(label=translations["alpha_label"], info=translations["alpha_info"], minimum=0.1, maximum=1, value=0.5, step=0.1, interactive=True, visible=False)
|
| 50 |
with gr.Column():
|
| 51 |
+
with gr.Accordion(label=translations["hubert_model"], open=True):
|
| 52 |
with gr.Row():
|
| 53 |
version = gr.Radio(label=translations["training_version"], info=translations["training_version_info"], choices=["v1", "v2"], value="v2", interactive=True)
|
| 54 |
with gr.Group():
|
|
|
|
| 94 |
],
|
| 95 |
outputs=[create_reference_info],
|
| 96 |
api_name="create_reference"
|
| 97 |
+
)
|
main/app/tabs/training/child/training.py
CHANGED
|
@@ -43,7 +43,7 @@ def training_model_tab():
|
|
| 43 |
with gr.Column():
|
| 44 |
with gr.Row():
|
| 45 |
with gr.Column():
|
| 46 |
-
with gr.Accordion(label=translations["f0_method"], open=
|
| 47 |
with gr.Group():
|
| 48 |
with gr.Row():
|
| 49 |
onnx_f0_mode2 = gr.Checkbox(label=translations["f0_onnx_mode"], value=False, interactive=True)
|
|
@@ -54,7 +54,7 @@ def training_model_tab():
|
|
| 54 |
extract_hop_length = gr.Slider(label=translations['hop_length'], info=translations["hop_length_info"], minimum=64, maximum=512, value=160, step=1, interactive=True, visible=False)
|
| 55 |
f0_autotune_strength = gr.Slider(minimum=0, maximum=1, label=translations["autotune_rate"], info=translations["autotune_rate_info"], value=1, step=0.1, interactive=True, visible=autotune.value)
|
| 56 |
alpha = gr.Slider(label=translations["alpha_label"], info=translations["alpha_info"], minimum=0.1, maximum=1, value=0.5, step=0.1, interactive=True, visible=False)
|
| 57 |
-
with gr.Accordion(label=translations["hubert_model"], open=
|
| 58 |
with gr.Group():
|
| 59 |
embed_mode2 = gr.Radio(label=translations["embed_mode"], info=translations["embed_mode_info"], value="fairseq", choices=embedders_mode, interactive=True, visible=True)
|
| 60 |
extract_embedders = gr.Radio(label=translations["hubert_model"], info=translations["hubert_info"], choices=embedders_model, value="hubert_base", interactive=True)
|
|
@@ -72,7 +72,7 @@ def training_model_tab():
|
|
| 72 |
index_button = gr.Button(f"3. {translations['create_index']}", variant="primary", scale=2)
|
| 73 |
training_button = gr.Button(f"4. {translations['training_model']}", variant="primary", scale=2)
|
| 74 |
with gr.Row():
|
| 75 |
-
with gr.Accordion(label=translations["setting"], open=
|
| 76 |
with gr.Row():
|
| 77 |
index_algorithm = gr.Radio(label=translations["index_algorithm"], info=translations["index_algorithm_info"], choices=["Auto", "Faiss", "KMeans"], value="Auto", interactive=True)
|
| 78 |
with gr.Row():
|
|
@@ -94,7 +94,7 @@ def training_model_tab():
|
|
| 94 |
chunk_len = gr.Slider(minimum=0.5, maximum=5.0, value=3.0, step=0.1, label=translations["chunk_length"], info=translations["chunk_length_info"], interactive=True)
|
| 95 |
overlap_len = gr.Slider(minimum=0.0, maximum=0.4, value=0.3, step=0.1, label=translations["overlap_length"], info=translations["overlap_length_info"], interactive=True)
|
| 96 |
threshold = gr.Slider(minimum=1, maximum=100, value=50, step=1, label=translations["threshold"], interactive=True, visible=overtraining_detector.value)
|
| 97 |
-
with gr.Accordion(translations["setting_cpu_gpu"], open=
|
| 98 |
with gr.Column():
|
| 99 |
gpu_number = gr.Textbox(label=translations["gpu_number"], value=gpu_number_str(), info=translations["gpu_number_info"], interactive=True)
|
| 100 |
gpu_info = gr.Textbox(label=translations["gpu_info"], value=get_gpu_info(), info=translations["gpu_info_2"], interactive=False)
|
|
@@ -112,7 +112,7 @@ def training_model_tab():
|
|
| 112 |
model_author = gr.Textbox(label=translations["training_author"], info=translations["training_author_info"], value="", placeholder=translations["training_author"], interactive=True)
|
| 113 |
with gr.Row():
|
| 114 |
with gr.Column():
|
| 115 |
-
with gr.Accordion(translations["custom_pretrain_info"], open=
|
| 116 |
pretrained_D = gr.Dropdown(label=translations["pretrain_file"].format(dg="D"), choices=pretrainedD, value=pretrainedD[0] if len(pretrainedD) > 0 else '', interactive=True, allow_custom_value=True)
|
| 117 |
pretrained_G = gr.Dropdown(label=translations["pretrain_file"].format(dg="G"), choices=pretrainedG, value=pretrainedG[0] if len(pretrainedG) > 0 else '', interactive=True, allow_custom_value=True)
|
| 118 |
refresh_pretrain = gr.Button(translations["refresh"], scale=2)
|
|
@@ -120,7 +120,7 @@ def training_model_tab():
|
|
| 120 |
training_info = gr.Textbox(label=translations["train_info"], value="", interactive=False, lines=3)
|
| 121 |
with gr.Row():
|
| 122 |
with gr.Column():
|
| 123 |
-
with gr.Accordion(translations["export_model"], open=
|
| 124 |
with gr.Row():
|
| 125 |
model_file = gr.Dropdown(label=translations["model_name"], choices=model_name, value=model_name[0] if len(model_name) >= 1 else "", interactive=True, allow_custom_value=True)
|
| 126 |
index_file = gr.Dropdown(label=translations["index_path"], choices=index_path, value=index_path[0] if len(index_path) >= 1 else "", interactive=True, allow_custom_value=True)
|
|
@@ -256,4 +256,4 @@ def training_model_tab():
|
|
| 256 |
],
|
| 257 |
outputs=[training_info],
|
| 258 |
api_name="training_model"
|
| 259 |
-
)
|
|
|
|
| 43 |
with gr.Column():
|
| 44 |
with gr.Row():
|
| 45 |
with gr.Column():
|
| 46 |
+
with gr.Accordion(label=translations["f0_method"], open=True):
|
| 47 |
with gr.Group():
|
| 48 |
with gr.Row():
|
| 49 |
onnx_f0_mode2 = gr.Checkbox(label=translations["f0_onnx_mode"], value=False, interactive=True)
|
|
|
|
| 54 |
extract_hop_length = gr.Slider(label=translations['hop_length'], info=translations["hop_length_info"], minimum=64, maximum=512, value=160, step=1, interactive=True, visible=False)
|
| 55 |
f0_autotune_strength = gr.Slider(minimum=0, maximum=1, label=translations["autotune_rate"], info=translations["autotune_rate_info"], value=1, step=0.1, interactive=True, visible=autotune.value)
|
| 56 |
alpha = gr.Slider(label=translations["alpha_label"], info=translations["alpha_info"], minimum=0.1, maximum=1, value=0.5, step=0.1, interactive=True, visible=False)
|
| 57 |
+
with gr.Accordion(label=translations["hubert_model"], open=True):
|
| 58 |
with gr.Group():
|
| 59 |
embed_mode2 = gr.Radio(label=translations["embed_mode"], info=translations["embed_mode_info"], value="fairseq", choices=embedders_mode, interactive=True, visible=True)
|
| 60 |
extract_embedders = gr.Radio(label=translations["hubert_model"], info=translations["hubert_info"], choices=embedders_model, value="hubert_base", interactive=True)
|
|
|
|
| 72 |
index_button = gr.Button(f"3. {translations['create_index']}", variant="primary", scale=2)
|
| 73 |
training_button = gr.Button(f"4. {translations['training_model']}", variant="primary", scale=2)
|
| 74 |
with gr.Row():
|
| 75 |
+
with gr.Accordion(label=translations["setting"], open=True):
|
| 76 |
with gr.Row():
|
| 77 |
index_algorithm = gr.Radio(label=translations["index_algorithm"], info=translations["index_algorithm_info"], choices=["Auto", "Faiss", "KMeans"], value="Auto", interactive=True)
|
| 78 |
with gr.Row():
|
|
|
|
| 94 |
chunk_len = gr.Slider(minimum=0.5, maximum=5.0, value=3.0, step=0.1, label=translations["chunk_length"], info=translations["chunk_length_info"], interactive=True)
|
| 95 |
overlap_len = gr.Slider(minimum=0.0, maximum=0.4, value=0.3, step=0.1, label=translations["overlap_length"], info=translations["overlap_length_info"], interactive=True)
|
| 96 |
threshold = gr.Slider(minimum=1, maximum=100, value=50, step=1, label=translations["threshold"], interactive=True, visible=overtraining_detector.value)
|
| 97 |
+
with gr.Accordion(translations["setting_cpu_gpu"], open=True):
|
| 98 |
with gr.Column():
|
| 99 |
gpu_number = gr.Textbox(label=translations["gpu_number"], value=gpu_number_str(), info=translations["gpu_number_info"], interactive=True)
|
| 100 |
gpu_info = gr.Textbox(label=translations["gpu_info"], value=get_gpu_info(), info=translations["gpu_info_2"], interactive=False)
|
|
|
|
| 112 |
model_author = gr.Textbox(label=translations["training_author"], info=translations["training_author_info"], value="", placeholder=translations["training_author"], interactive=True)
|
| 113 |
with gr.Row():
|
| 114 |
with gr.Column():
|
| 115 |
+
with gr.Accordion(translations["custom_pretrain_info"], open=True, visible=custom_pretrain.value and not not_use_pretrain.value) as pretrain_setting:
|
| 116 |
pretrained_D = gr.Dropdown(label=translations["pretrain_file"].format(dg="D"), choices=pretrainedD, value=pretrainedD[0] if len(pretrainedD) > 0 else '', interactive=True, allow_custom_value=True)
|
| 117 |
pretrained_G = gr.Dropdown(label=translations["pretrain_file"].format(dg="G"), choices=pretrainedG, value=pretrainedG[0] if len(pretrainedG) > 0 else '', interactive=True, allow_custom_value=True)
|
| 118 |
refresh_pretrain = gr.Button(translations["refresh"], scale=2)
|
|
|
|
| 120 |
training_info = gr.Textbox(label=translations["train_info"], value="", interactive=False, lines=3)
|
| 121 |
with gr.Row():
|
| 122 |
with gr.Column():
|
| 123 |
+
with gr.Accordion(translations["export_model"], open=True):
|
| 124 |
with gr.Row():
|
| 125 |
model_file = gr.Dropdown(label=translations["model_name"], choices=model_name, value=model_name[0] if len(model_name) >= 1 else "", interactive=True, allow_custom_value=True)
|
| 126 |
index_file = gr.Dropdown(label=translations["index_path"], choices=index_path, value=index_path[0] if len(index_path) >= 1 else "", interactive=True, allow_custom_value=True)
|
|
|
|
| 256 |
],
|
| 257 |
outputs=[training_info],
|
| 258 |
api_name="training_model"
|
| 259 |
+
)
|