Spaces:
Running
Running
Update main/app/app.py
Browse files- main/app/app.py +4 -592
main/app/app.py
CHANGED
|
@@ -24,7 +24,7 @@ import soundfile as sf
|
|
| 24 |
|
| 25 |
from time import sleep
|
| 26 |
from multiprocessing import cpu_count
|
| 27 |
-
|
| 28 |
sys.path.append(os.getcwd())
|
| 29 |
|
| 30 |
from main.tools import huggingface
|
|
@@ -139,452 +139,8 @@ with gr.Blocks(title=" Ultimate RVC Maker ⚡", theme=theme) as app:
|
|
| 139 |
api_name='separator_music'
|
| 140 |
)
|
| 141 |
|
| 142 |
-
with gr.TabItem(
|
| 143 |
-
|
| 144 |
-
with gr.Row():
|
| 145 |
-
gr.Markdown(translations["convert_info"])
|
| 146 |
-
|
| 147 |
-
with gr.Row():
|
| 148 |
-
with gr.Column():
|
| 149 |
-
with gr.Accordion(translations["model_accordion"], open=True):
|
| 150 |
-
with gr.Row():
|
| 151 |
-
model_pth = 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)
|
| 152 |
-
model_index = 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)
|
| 153 |
-
refesh = gr.Button(translations["refesh"])
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
with gr.Row():
|
| 157 |
-
with gr.Column():
|
| 158 |
-
audio_select = gr.Dropdown(label=translations["select_separate"], choices=[], value="", interactive=True, allow_custom_value=True, visible=False)
|
| 159 |
-
convert_button_2 = gr.Button(translations["convert_audio"], visible=False)
|
| 160 |
-
with gr.Row():
|
| 161 |
-
with gr.Column():
|
| 162 |
-
input0 = gr.File(label=translations["drop_audio"], file_types=[".wav", ".mp3", ".flac", ".ogg", ".opus", ".m4a", ".mp4", ".aac", ".alac", ".wma", ".aiff", ".webm", ".ac3"])
|
| 163 |
-
play_audio = gr.Audio(show_download_button=True, interactive=False, label=translations["input_audio"])
|
| 164 |
-
with gr.Row():
|
| 165 |
-
with gr.Column():
|
| 166 |
-
with gr.Row():
|
| 167 |
-
index_strength = 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_index.value != "")
|
| 168 |
-
with gr.Row():
|
| 169 |
-
with gr.Column():
|
| 170 |
-
with gr.Accordion(translations["input_output"], open=False):
|
| 171 |
-
with gr.Column():
|
| 172 |
-
export_format = gr.Radio(label=translations["export_format"], info=translations["export_info"], choices=["wav", "mp3", "flac", "ogg", "opus", "m4a", "mp4", "aac", "alac", "wma", "aiff", "webm", "ac3"], value="wav", interactive=True)
|
| 173 |
-
input_audio0 = gr.Dropdown(label=translations["audio_path"], value="", choices=paths_for_files, info=translations["provide_audio"], allow_custom_value=True, interactive=True)
|
| 174 |
-
output_audio = gr.Textbox(label=translations["output_path"], value="audios/output.wav", placeholder="audios/output.wav", info=translations["output_path_info"], interactive=True)
|
| 175 |
-
with gr.Column():
|
| 176 |
-
refesh0 = gr.Button(translations["refesh"])
|
| 177 |
-
with gr.Accordion(translations["setting"], open=False):
|
| 178 |
-
with gr.Row():
|
| 179 |
-
cleaner0 = gr.Checkbox(label=translations["clear_audio"], value=False, interactive=True)
|
| 180 |
-
autotune = gr.Checkbox(label=translations["autotune"], value=False, interactive=True)
|
| 181 |
-
use_audio = gr.Checkbox(label=translations["use_audio"], value=False, interactive=True)
|
| 182 |
-
checkpointing = gr.Checkbox(label=translations["memory_efficient_training"], value=False, interactive=True)
|
| 183 |
-
with gr.Row():
|
| 184 |
-
use_original = gr.Checkbox(label=translations["convert_original"], value=False, interactive=True, visible=use_audio.value)
|
| 185 |
-
convert_backing = gr.Checkbox(label=translations["convert_backing"], value=False, interactive=True, visible=use_audio.value)
|
| 186 |
-
not_merge_backing = gr.Checkbox(label=translations["not_merge_backing"], value=False, interactive=True, visible=use_audio.value)
|
| 187 |
-
merge_instrument = gr.Checkbox(label=translations["merge_instruments"], value=False, interactive=True, visible=use_audio.value)
|
| 188 |
-
with gr.Row():
|
| 189 |
-
pitch = gr.Slider(minimum=-20, maximum=20, step=1, info=translations["pitch_info"], label=translations["pitch"], value=0, interactive=True)
|
| 190 |
-
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)
|
| 191 |
-
|
| 192 |
-
with gr.Accordion(translations["f0_method"], open=False):
|
| 193 |
-
with gr.Group():
|
| 194 |
-
with gr.Row():
|
| 195 |
-
onnx_f0_mode = gr.Checkbox(label=translations["f0_onnx_mode"], info=translations["f0_onnx_mode_info"], value=False, interactive=True)
|
| 196 |
-
unlock_full_method = gr.Checkbox(label=translations["f0_unlock"], info=translations["f0_unlock_info"], value=False, interactive=True)
|
| 197 |
-
method = gr.Radio(label=translations["f0_method"], info=translations["f0_method_info"], choices=method_f0+["hybrid"], value="rmvpe", interactive=True)
|
| 198 |
-
hybrid_method = gr.Dropdown(label=translations["f0_method_hybrid"], info=translations["f0_method_hybrid_info"], choices=["hybrid[pm+dio]", "hybrid[pm+crepe-tiny]", "hybrid[pm+crepe]", "hybrid[pm+fcpe]", "hybrid[pm+rmvpe]", "hybrid[pm+harvest]", "hybrid[pm+yin]", "hybrid[dio+crepe-tiny]", "hybrid[dio+crepe]", "hybrid[dio+fcpe]", "hybrid[dio+rmvpe]", "hybrid[dio+harvest]", "hybrid[dio+yin]", "hybrid[crepe-tiny+crepe]", "hybrid[crepe-tiny+fcpe]", "hybrid[crepe-tiny+rmvpe]", "hybrid[crepe-tiny+harvest]", "hybrid[crepe+fcpe]", "hybrid[crepe+rmvpe]", "hybrid[crepe+harvest]", "hybrid[crepe+yin]", "hybrid[fcpe+rmvpe]", "hybrid[fcpe+harvest]", "hybrid[fcpe+yin]", "hybrid[rmvpe+harvest]", "hybrid[rmvpe+yin]", "hybrid[harvest+yin]"], value="hybrid[pm+dio]", interactive=True, allow_custom_value=True, visible=method.value == "hybrid")
|
| 199 |
-
hop_length = gr.Slider(label="Hop length", info=translations["hop_length_info"], minimum=1, maximum=512, value=128, step=1, interactive=True, visible=False)
|
| 200 |
-
with gr.Accordion(translations["f0_file"], open=False):
|
| 201 |
-
upload_f0_file = gr.File(label=translations["upload_f0"], file_types=[".txt"])
|
| 202 |
-
f0_file_dropdown = gr.Dropdown(label=translations["f0_file_2"], value="", choices=f0_file, allow_custom_value=True, interactive=True)
|
| 203 |
-
refesh_f0_file = gr.Button(translations["refesh"])
|
| 204 |
-
with gr.Accordion(translations["hubert_model"], open=False):
|
| 205 |
-
embed_mode = gr.Radio(label=translations["embed_mode"], info=translations["embed_mode_info"], value="fairseq", choices=embedders_mode, interactive=True, visible=True)
|
| 206 |
-
embedders = gr.Radio(label=translations["hubert_model"], info=translations["hubert_info"], choices=embedders_model, value="hubert_base", interactive=True)
|
| 207 |
-
custom_embedders = gr.Textbox(label=translations["modelname"], info=translations["modelname_info"], value="", placeholder="hubert_base", interactive=True, visible=embedders.value == "custom")
|
| 208 |
-
with gr.Accordion(translations["use_presets"], open=False):
|
| 209 |
-
with gr.Row():
|
| 210 |
-
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)
|
| 211 |
-
with gr.Row():
|
| 212 |
-
load_click = gr.Button(translations["load_file"], variant="primary")
|
| 213 |
-
refesh_click = gr.Button(translations["refesh"])
|
| 214 |
-
with gr.Accordion(translations["export_file"], open=False):
|
| 215 |
-
with gr.Row():
|
| 216 |
-
with gr.Column():
|
| 217 |
-
with gr.Group():
|
| 218 |
-
with gr.Row():
|
| 219 |
-
cleaner_chbox = gr.Checkbox(label=translations["save_clean"], value=True, interactive=True)
|
| 220 |
-
autotune_chbox = gr.Checkbox(label=translations["save_autotune"], value=True, interactive=True)
|
| 221 |
-
pitch_chbox = gr.Checkbox(label=translations["save_pitch"], value=True, interactive=True)
|
| 222 |
-
index_strength_chbox = gr.Checkbox(label=translations["save_index_2"], value=True, interactive=True)
|
| 223 |
-
resample_sr_chbox = gr.Checkbox(label=translations["save_resample"], value=True, interactive=True)
|
| 224 |
-
filter_radius_chbox = gr.Checkbox(label=translations["save_filter"], value=True, interactive=True)
|
| 225 |
-
volume_envelope_chbox = gr.Checkbox(label=translations["save_envelope"], value=True, interactive=True)
|
| 226 |
-
protect_chbox = gr.Checkbox(label=translations["save_protect"], value=True, interactive=True)
|
| 227 |
-
split_audio_chbox = gr.Checkbox(label=translations["save_split"], value=True, interactive=True)
|
| 228 |
-
formant_shifting_chbox = gr.Checkbox(label=translations["formantshift"], value=True, interactive=True)
|
| 229 |
-
with gr.Row():
|
| 230 |
-
with gr.Column():
|
| 231 |
-
name_to_save_file = gr.Textbox(label=translations["filename_to_save"])
|
| 232 |
-
save_file_button = gr.Button(translations["export_file"])
|
| 233 |
-
with gr.Row():
|
| 234 |
-
upload_presets = gr.File(label=translations["upload_presets"], file_types=[".json"])
|
| 235 |
-
with gr.Column():
|
| 236 |
-
with gr.Row():
|
| 237 |
-
split_audio = gr.Checkbox(label=translations["split_audio"], value=False, interactive=True)
|
| 238 |
-
formant_shifting = gr.Checkbox(label=translations["formantshift"], value=False, interactive=True)
|
| 239 |
-
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)
|
| 240 |
-
resample_sr = gr.Slider(minimum=0, maximum=96000, label=translations["resample"], info=translations["resample_info"], value=0, step=1, interactive=True)
|
| 241 |
-
filter_radius = gr.Slider(minimum=0, maximum=7, label=translations["filter_radius"], info=translations["filter_radius_info"], value=3, step=1, interactive=True)
|
| 242 |
-
volume_envelope = gr.Slider(minimum=0, maximum=1, label=translations["volume_envelope"], info=translations["volume_envelope_info"], value=1, step=0.1, interactive=True)
|
| 243 |
-
protect = gr.Slider(minimum=0, maximum=1, label=translations["protect"], info=translations["protect_info"], value=0.5, step=0.01, interactive=True)
|
| 244 |
-
with gr.Row():
|
| 245 |
-
formant_qfrency = gr.Slider(value=1.0, label=translations["formant_qfrency"], info=translations["formant_qfrency"], minimum=0.0, maximum=16.0, step=0.1, interactive=True, visible=False)
|
| 246 |
-
formant_timbre = gr.Slider(value=1.0, label=translations["formant_timbre"], info=translations["formant_timbre"], minimum=0.0, maximum=16.0, step=0.1, interactive=True, visible=False)
|
| 247 |
-
with gr.Row():
|
| 248 |
-
convert_button = gr.Button(translations["convert_audio"], variant="primary")
|
| 249 |
-
gr.Markdown(translations["output_convert"])
|
| 250 |
-
with gr.Row():
|
| 251 |
-
main_convert = gr.Audio(show_download_button=True, interactive=False, label=translations["main_convert"])
|
| 252 |
-
backing_convert = gr.Audio(show_download_button=True, interactive=False, label=translations["convert_backing"], visible=convert_backing.value)
|
| 253 |
-
main_backing = gr.Audio(show_download_button=True, interactive=False, label=translations["main_or_backing"], visible=convert_backing.value)
|
| 254 |
-
with gr.Row():
|
| 255 |
-
original_convert = gr.Audio(show_download_button=True, interactive=False, label=translations["convert_original"], visible=use_original.value)
|
| 256 |
-
vocal_instrument = gr.Audio(show_download_button=True, interactive=False, label=translations["voice_or_instruments"], visible=merge_instrument.value)
|
| 257 |
-
with gr.Row():
|
| 258 |
-
upload_f0_file.upload(fn=lambda inp: shutil.move(inp.name, os.path.join("assets", "f0")), inputs=[upload_f0_file], outputs=[f0_file_dropdown])
|
| 259 |
-
refesh_f0_file.click(fn=change_f0_choices, inputs=[], outputs=[f0_file_dropdown])
|
| 260 |
-
unlock_full_method.change(fn=unlock_f0, inputs=[unlock_full_method], outputs=[method])
|
| 261 |
-
with gr.Row():
|
| 262 |
-
load_click.click(
|
| 263 |
-
fn=load_presets,
|
| 264 |
-
inputs=[
|
| 265 |
-
presets_name,
|
| 266 |
-
cleaner0,
|
| 267 |
-
autotune,
|
| 268 |
-
pitch,
|
| 269 |
-
clean_strength0,
|
| 270 |
-
index_strength,
|
| 271 |
-
resample_sr,
|
| 272 |
-
filter_radius,
|
| 273 |
-
volume_envelope,
|
| 274 |
-
protect,
|
| 275 |
-
split_audio,
|
| 276 |
-
f0_autotune_strength,
|
| 277 |
-
formant_qfrency,
|
| 278 |
-
formant_timbre
|
| 279 |
-
],
|
| 280 |
-
outputs=[
|
| 281 |
-
cleaner0,
|
| 282 |
-
autotune,
|
| 283 |
-
pitch,
|
| 284 |
-
clean_strength0,
|
| 285 |
-
index_strength,
|
| 286 |
-
resample_sr,
|
| 287 |
-
filter_radius,
|
| 288 |
-
volume_envelope,
|
| 289 |
-
protect,
|
| 290 |
-
split_audio,
|
| 291 |
-
f0_autotune_strength,
|
| 292 |
-
formant_shifting,
|
| 293 |
-
formant_qfrency,
|
| 294 |
-
formant_timbre
|
| 295 |
-
]
|
| 296 |
-
)
|
| 297 |
-
refesh_click.click(fn=change_preset_choices, inputs=[], outputs=[presets_name])
|
| 298 |
-
save_file_button.click(
|
| 299 |
-
fn=save_presets,
|
| 300 |
-
inputs=[
|
| 301 |
-
name_to_save_file,
|
| 302 |
-
cleaner0,
|
| 303 |
-
autotune,
|
| 304 |
-
pitch,
|
| 305 |
-
clean_strength0,
|
| 306 |
-
index_strength,
|
| 307 |
-
resample_sr,
|
| 308 |
-
filter_radius,
|
| 309 |
-
volume_envelope,
|
| 310 |
-
protect,
|
| 311 |
-
split_audio,
|
| 312 |
-
f0_autotune_strength,
|
| 313 |
-
cleaner_chbox,
|
| 314 |
-
autotune_chbox,
|
| 315 |
-
pitch_chbox,
|
| 316 |
-
index_strength_chbox,
|
| 317 |
-
resample_sr_chbox,
|
| 318 |
-
filter_radius_chbox,
|
| 319 |
-
volume_envelope_chbox,
|
| 320 |
-
protect_chbox,
|
| 321 |
-
split_audio_chbox,
|
| 322 |
-
formant_shifting_chbox,
|
| 323 |
-
formant_shifting,
|
| 324 |
-
formant_qfrency,
|
| 325 |
-
formant_timbre
|
| 326 |
-
],
|
| 327 |
-
outputs=[presets_name]
|
| 328 |
-
)
|
| 329 |
-
with gr.Row():
|
| 330 |
-
upload_presets.upload(fn=lambda audio_in: shutil.move(audio_in.name, os.path.join("assets", "presets")), inputs=[upload_presets], outputs=[presets_name])
|
| 331 |
-
autotune.change(fn=visible, inputs=[autotune], outputs=[f0_autotune_strength])
|
| 332 |
-
use_audio.change(fn=lambda a: [visible(a), visible(a), visible(a), visible(a), visible(a), valueFalse_interactive(a), valueFalse_interactive(a), valueFalse_interactive(a), valueFalse_interactive(a), visible(not a), visible(not a), visible(not a), visible(not a)], inputs=[use_audio], outputs=[main_backing, use_original, convert_backing, not_merge_backing, merge_instrument, use_original, convert_backing, not_merge_backing, merge_instrument, input_audio0, output_audio, input0, play_audio])
|
| 333 |
-
with gr.Row():
|
| 334 |
-
convert_backing.change(fn=lambda a,b: [change_backing_choices(a, b), visible(a)], inputs=[convert_backing, not_merge_backing], outputs=[use_original, backing_convert])
|
| 335 |
-
use_original.change(fn=lambda audio, original: [visible(original), visible(not original), visible(audio and not original), valueFalse_interactive(not original), valueFalse_interactive(not original)], inputs=[use_audio, use_original], outputs=[original_convert, main_convert, main_backing, convert_backing, not_merge_backing])
|
| 336 |
-
cleaner0.change(fn=visible, inputs=[cleaner0], outputs=[clean_strength0])
|
| 337 |
-
with gr.Row():
|
| 338 |
-
merge_instrument.change(fn=visible, inputs=[merge_instrument], outputs=[vocal_instrument])
|
| 339 |
-
not_merge_backing.change(fn=lambda audio, merge, cvb: [visible(audio and not merge), change_backing_choices(cvb, merge)], inputs=[use_audio, not_merge_backing, convert_backing], outputs=[main_backing, use_original])
|
| 340 |
-
method.change(fn=lambda method, hybrid: [visible(method == "hybrid"), hoplength_show(method, hybrid)], inputs=[method, hybrid_method], outputs=[hybrid_method, hop_length])
|
| 341 |
-
with gr.Row():
|
| 342 |
-
hybrid_method.change(fn=hoplength_show, inputs=[method, hybrid_method], outputs=[hop_length])
|
| 343 |
-
refesh.click(fn=change_models_choices, inputs=[], outputs=[model_pth, model_index])
|
| 344 |
-
model_pth.change(fn=get_index, inputs=[model_pth], outputs=[model_index])
|
| 345 |
-
with gr.Row():
|
| 346 |
-
input0.upload(fn=lambda audio_in: shutil.move(audio_in.name, os.path.join("audios")), inputs=[input0], outputs=[input_audio0])
|
| 347 |
-
input_audio0.change(fn=lambda audio: audio if os.path.isfile(audio) else None, inputs=[input_audio0], outputs=[play_audio])
|
| 348 |
-
formant_shifting.change(fn=lambda a: [visible(a)]*2, inputs=[formant_shifting], outputs=[formant_qfrency, formant_timbre])
|
| 349 |
-
with gr.Row():
|
| 350 |
-
embedders.change(fn=lambda embedders: visible(embedders == "custom"), inputs=[embedders], outputs=[custom_embedders])
|
| 351 |
-
refesh0.click(fn=change_audios_choices, inputs=[input_audio0], outputs=[input_audio0])
|
| 352 |
-
model_index.change(fn=index_strength_show, inputs=[model_index], outputs=[index_strength])
|
| 353 |
-
with gr.Row():
|
| 354 |
-
audio_select.change(fn=lambda: visible(True), inputs=[], outputs=[convert_button_2])
|
| 355 |
-
convert_button.click(fn=lambda: visible(False), inputs=[], outputs=[convert_button])
|
| 356 |
-
convert_button_2.click(fn=lambda: [visible(False), visible(False)], inputs=[], outputs=[audio_select, convert_button_2])
|
| 357 |
-
with gr.Row():
|
| 358 |
-
convert_button.click(
|
| 359 |
-
fn=convert_selection,
|
| 360 |
-
inputs=[
|
| 361 |
-
cleaner0,
|
| 362 |
-
autotune,
|
| 363 |
-
use_audio,
|
| 364 |
-
use_original,
|
| 365 |
-
convert_backing,
|
| 366 |
-
not_merge_backing,
|
| 367 |
-
merge_instrument,
|
| 368 |
-
pitch,
|
| 369 |
-
clean_strength0,
|
| 370 |
-
model_pth,
|
| 371 |
-
model_index,
|
| 372 |
-
index_strength,
|
| 373 |
-
input_audio0,
|
| 374 |
-
output_audio,
|
| 375 |
-
export_format,
|
| 376 |
-
method,
|
| 377 |
-
hybrid_method,
|
| 378 |
-
hop_length,
|
| 379 |
-
embedders,
|
| 380 |
-
custom_embedders,
|
| 381 |
-
resample_sr,
|
| 382 |
-
filter_radius,
|
| 383 |
-
volume_envelope,
|
| 384 |
-
protect,
|
| 385 |
-
split_audio,
|
| 386 |
-
f0_autotune_strength,
|
| 387 |
-
checkpointing,
|
| 388 |
-
onnx_f0_mode,
|
| 389 |
-
formant_shifting,
|
| 390 |
-
formant_qfrency,
|
| 391 |
-
formant_timbre,
|
| 392 |
-
f0_file_dropdown,
|
| 393 |
-
embed_mode
|
| 394 |
-
],
|
| 395 |
-
outputs=[audio_select, main_convert, backing_convert, main_backing, original_convert, vocal_instrument, convert_button],
|
| 396 |
-
api_name="convert_selection"
|
| 397 |
-
)
|
| 398 |
-
embed_mode.change(fn=visible_embedders, inputs=[embed_mode], outputs=[embedders])
|
| 399 |
-
convert_button_2.click(
|
| 400 |
-
fn=convert_audio,
|
| 401 |
-
inputs=[
|
| 402 |
-
cleaner0,
|
| 403 |
-
autotune,
|
| 404 |
-
use_audio,
|
| 405 |
-
use_original,
|
| 406 |
-
convert_backing,
|
| 407 |
-
not_merge_backing,
|
| 408 |
-
merge_instrument,
|
| 409 |
-
pitch,
|
| 410 |
-
clean_strength0,
|
| 411 |
-
model_pth,
|
| 412 |
-
model_index,
|
| 413 |
-
index_strength,
|
| 414 |
-
input_audio0,
|
| 415 |
-
output_audio,
|
| 416 |
-
export_format,
|
| 417 |
-
method,
|
| 418 |
-
hybrid_method,
|
| 419 |
-
hop_length,
|
| 420 |
-
embedders,
|
| 421 |
-
custom_embedders,
|
| 422 |
-
resample_sr,
|
| 423 |
-
filter_radius,
|
| 424 |
-
volume_envelope,
|
| 425 |
-
protect,
|
| 426 |
-
split_audio,
|
| 427 |
-
f0_autotune_strength,
|
| 428 |
-
audio_select,
|
| 429 |
-
checkpointing,
|
| 430 |
-
onnx_f0_mode,
|
| 431 |
-
formant_shifting,
|
| 432 |
-
formant_qfrency,
|
| 433 |
-
formant_timbre,
|
| 434 |
-
f0_file_dropdown,
|
| 435 |
-
embed_mode
|
| 436 |
-
],
|
| 437 |
-
outputs=[main_convert, backing_convert, main_backing, original_convert, vocal_instrument, convert_button],
|
| 438 |
-
api_name="convert_audio"
|
| 439 |
-
)
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
with gr.TabItem(translations["convert_text"], visible=configs.get("tts_tab", True)):
|
| 443 |
-
gr.Markdown(translations["convert_text_markdown"])
|
| 444 |
-
with gr.Row():
|
| 445 |
-
gr.Markdown(translations["convert_text_markdown_2"])
|
| 446 |
-
with gr.Accordion(translations["model_accordion"], open=True):
|
| 447 |
-
with gr.Row():
|
| 448 |
-
model_pth0 = 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)
|
| 449 |
-
model_index0 = 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)
|
| 450 |
-
|
| 451 |
-
with gr.Row():
|
| 452 |
-
with gr.Column():
|
| 453 |
-
with gr.Group():
|
| 454 |
-
with gr.Row():
|
| 455 |
-
use_txt = gr.Checkbox(label=translations["input_txt"], value=False, interactive=True)
|
| 456 |
-
google_tts_check_box = gr.Checkbox(label=translations["googletts"], value=False, interactive=True)
|
| 457 |
-
prompt = gr.Textbox(label=translations["text_to_speech"], value="", placeholder="Hello Words", lines=3)
|
| 458 |
-
with gr.Column():
|
| 459 |
-
speed = gr.Slider(label=translations["voice_speed"], info=translations["voice_speed_info"], minimum=-100, maximum=100, value=0, step=1)
|
| 460 |
-
pitch0 = gr.Slider(minimum=-20, maximum=20, step=1, info=translations["pitch_info"], label=translations["pitch"], value=0, interactive=True)
|
| 461 |
-
with gr.Row():
|
| 462 |
-
tts_button = gr.Button(translations["tts_1"], variant="primary", scale=2)
|
| 463 |
-
convert_button0 = gr.Button(translations["tts_2"], variant="secondary", scale=2)
|
| 464 |
-
with gr.Row():
|
| 465 |
-
with gr.Column():
|
| 466 |
-
txt_input = gr.File(label=translations["drop_text"], file_types=[".txt", ".srt"], visible=use_txt.value)
|
| 467 |
-
tts_voice = gr.Dropdown(label=translations["voice"], choices=edgetts, interactive=True, value="vi-VN-NamMinhNeural")
|
| 468 |
-
tts_pitch = gr.Slider(minimum=-20, maximum=20, step=1, info=translations["pitch_info_2"], label=translations["pitch"], value=0, interactive=True)
|
| 469 |
-
with gr.Column():
|
| 470 |
-
refesh1 = gr.Button(translations["refesh"])
|
| 471 |
-
with gr.Row():
|
| 472 |
-
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 != "")
|
| 473 |
-
with gr.Accordion(translations["output_path"], open=False):
|
| 474 |
-
export_format0 = gr.Radio(label=translations["export_format"], info=translations["export_info"], choices=["wav", "mp3", "flac", "ogg", "opus", "m4a", "mp4", "aac", "alac", "wma", "aiff", "webm", "ac3"], value="wav", interactive=True)
|
| 475 |
-
output_audio0 = gr.Textbox(label=translations["output_tts"], value="audios/tts.wav", placeholder="audios/tts.wav", info=translations["tts_output"], interactive=True)
|
| 476 |
-
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)
|
| 477 |
-
with gr.Accordion(translations["setting"], open=False):
|
| 478 |
-
with gr.Accordion(translations["f0_method"], open=False):
|
| 479 |
-
with gr.Group():
|
| 480 |
-
with gr.Row():
|
| 481 |
-
onnx_f0_mode1 = gr.Checkbox(label=translations["f0_onnx_mode"], info=translations["f0_onnx_mode_info"], value=False, interactive=True)
|
| 482 |
-
unlock_full_method3 = gr.Checkbox(label=translations["f0_unlock"], info=translations["f0_unlock_info"], value=False, interactive=True)
|
| 483 |
-
method0 = gr.Radio(label=translations["f0_method"], info=translations["f0_method_info"], choices=method_f0+["hybrid"], value="rmvpe", interactive=True)
|
| 484 |
-
hybrid_method0 = gr.Dropdown(label=translations["f0_method_hybrid"], info=translations["f0_method_hybrid_info"], choices=["hybrid[pm+dio]", "hybrid[pm+crepe-tiny]", "hybrid[pm+crepe]", "hybrid[pm+fcpe]", "hybrid[pm+rmvpe]", "hybrid[pm+harvest]", "hybrid[pm+yin]", "hybrid[dio+crepe-tiny]", "hybrid[dio+crepe]", "hybrid[dio+fcpe]", "hybrid[dio+rmvpe]", "hybrid[dio+harvest]", "hybrid[dio+yin]", "hybrid[crepe-tiny+crepe]", "hybrid[crepe-tiny+fcpe]", "hybrid[crepe-tiny+rmvpe]", "hybrid[crepe-tiny+harvest]", "hybrid[crepe+fcpe]", "hybrid[crepe+rmvpe]", "hybrid[crepe+harvest]", "hybrid[crepe+yin]", "hybrid[fcpe+rmvpe]", "hybrid[fcpe+harvest]", "hybrid[fcpe+yin]", "hybrid[rmvpe+harvest]", "hybrid[rmvpe+yin]", "hybrid[harvest+yin]"], value="hybrid[pm+dio]", interactive=True, allow_custom_value=True, visible=method0.value == "hybrid")
|
| 485 |
-
hop_length0 = gr.Slider(label="Hop length", info=translations["hop_length_info"], minimum=1, maximum=512, value=128, step=1, interactive=True, visible=False)
|
| 486 |
-
with gr.Accordion(translations["f0_file"], open=False):
|
| 487 |
-
upload_f0_file0 = gr.File(label=translations["upload_f0"], file_types=[".txt"])
|
| 488 |
-
f0_file_dropdown0 = gr.Dropdown(label=translations["f0_file_2"], value="", choices=f0_file, allow_custom_value=True, interactive=True)
|
| 489 |
-
refesh_f0_file0 = gr.Button(translations["refesh"])
|
| 490 |
-
with gr.Accordion(translations["hubert_model"], open=False):
|
| 491 |
-
embed_mode1 = gr.Radio(label=translations["embed_mode"], info=translations["embed_mode_info"], value="fairseq", choices=embedders_mode, interactive=True, visible=True)
|
| 492 |
-
embedders0 = gr.Radio(label=translations["hubert_model"], info=translations["hubert_info"], choices=embedders_model, value="hubert_base", interactive=True)
|
| 493 |
-
custom_embedders0 = gr.Textbox(label=translations["modelname"], info=translations["modelname_info"], value="", placeholder="hubert_base", interactive=True, visible=embedders0.value == "custom")
|
| 494 |
-
with gr.Group():
|
| 495 |
-
with gr.Row():
|
| 496 |
-
formant_shifting1 = gr.Checkbox(label=translations["formantshift"], value=False, interactive=True)
|
| 497 |
-
split_audio0 = gr.Checkbox(label=translations["split_audio"], value=False, interactive=True)
|
| 498 |
-
cleaner1 = gr.Checkbox(label=translations["clear_audio"], value=False, interactive=True)
|
| 499 |
-
autotune3 = gr.Checkbox(label=translations["autotune"], value=False, interactive=True)
|
| 500 |
-
checkpointing0 = gr.Checkbox(label=translations["memory_efficient_training"], value=False, interactive=True)
|
| 501 |
-
with gr.Column():
|
| 502 |
-
f0_autotune_strength0 = gr.Slider(minimum=0, maximum=1, label=translations["autotune_rate"], info=translations["autotune_rate_info"], value=1, step=0.1, interactive=True, visible=autotune3.value)
|
| 503 |
-
clean_strength1 = gr.Slider(label=translations["clean_strength"], info=translations["clean_strength_info"], minimum=0, maximum=1, value=0.5, step=0.1, interactive=True, visible=cleaner1.value)
|
| 504 |
-
resample_sr0 = gr.Slider(minimum=0, maximum=96000, label=translations["resample"], info=translations["resample_info"], value=0, step=1, interactive=True)
|
| 505 |
-
filter_radius0 = gr.Slider(minimum=0, maximum=7, label=translations["filter_radius"], info=translations["filter_radius_info"], value=3, step=1, interactive=True)
|
| 506 |
-
volume_envelope0 = gr.Slider(minimum=0, maximum=1, label=translations["volume_envelope"], info=translations["volume_envelope_info"], value=1, step=0.1, interactive=True)
|
| 507 |
-
protect0 = gr.Slider(minimum=0, maximum=1, label=translations["protect"], info=translations["protect_info"], value=0.5, step=0.01, interactive=True)
|
| 508 |
-
with gr.Row():
|
| 509 |
-
formant_qfrency1 = gr.Slider(value=1.0, label=translations["formant_qfrency"], info=translations["formant_qfrency"], minimum=0.0, maximum=16.0, step=0.1, interactive=True, visible=False)
|
| 510 |
-
formant_timbre1 = gr.Slider(value=1.0, label=translations["formant_timbre"], info=translations["formant_timbre"], minimum=0.0, maximum=16.0, step=0.1, interactive=True, visible=False)
|
| 511 |
-
with gr.Row():
|
| 512 |
-
gr.Markdown(translations["output_tts_markdown"])
|
| 513 |
-
with gr.Row():
|
| 514 |
-
tts_voice_audio = gr.Audio(show_download_button=True, interactive=False, label=translations["output_text_to_speech"])
|
| 515 |
-
tts_voice_convert = gr.Audio(show_download_button=True, interactive=False, label=translations["output_file_tts_convert"])
|
| 516 |
-
with gr.Row():
|
| 517 |
-
unlock_full_method3.change(fn=unlock_f0, inputs=[unlock_full_method3], outputs=[method0])
|
| 518 |
-
upload_f0_file0.upload(fn=lambda inp: shutil.move(inp.name, os.path.join("assets", "f0")), inputs=[upload_f0_file0], outputs=[f0_file_dropdown0])
|
| 519 |
-
refesh_f0_file0.click(fn=change_f0_choices, inputs=[], outputs=[f0_file_dropdown0])
|
| 520 |
-
with gr.Row():
|
| 521 |
-
embed_mode1.change(fn=visible_embedders, inputs=[embed_mode1], outputs=[embedders0])
|
| 522 |
-
autotune3.change(fn=visible, inputs=[autotune3], outputs=[f0_autotune_strength0])
|
| 523 |
-
model_pth0.change(fn=get_index, inputs=[model_pth0], outputs=[model_index0])
|
| 524 |
-
with gr.Row():
|
| 525 |
-
cleaner1.change(fn=visible, inputs=[cleaner1], outputs=[clean_strength1])
|
| 526 |
-
method0.change(fn=lambda method, hybrid: [visible(method == "hybrid"), hoplength_show(method, hybrid)], inputs=[method0, hybrid_method0], outputs=[hybrid_method0, hop_length0])
|
| 527 |
-
hybrid_method0.change(fn=hoplength_show, inputs=[method0, hybrid_method0], outputs=[hop_length0])
|
| 528 |
-
with gr.Row():
|
| 529 |
-
refesh1.click(fn=change_models_choices, inputs=[], outputs=[model_pth0, model_index0])
|
| 530 |
-
embedders0.change(fn=lambda embedders: visible(embedders == "custom"), inputs=[embedders0], outputs=[custom_embedders0])
|
| 531 |
-
formant_shifting1.change(fn=lambda a: [visible(a)]*2, inputs=[formant_shifting1], outputs=[formant_qfrency1, formant_timbre1])
|
| 532 |
-
with gr.Row():
|
| 533 |
-
model_index0.change(fn=index_strength_show, inputs=[model_index0], outputs=[index_strength0])
|
| 534 |
-
txt_input.upload(fn=process_input, inputs=[txt_input], outputs=[prompt])
|
| 535 |
-
use_txt.change(fn=visible, inputs=[use_txt], outputs=[txt_input])
|
| 536 |
-
with gr.Row():
|
| 537 |
-
google_tts_check_box.change(fn=change_tts_voice_choices, inputs=[google_tts_check_box], outputs=[tts_voice])
|
| 538 |
-
tts_button.click(
|
| 539 |
-
fn=TTS,
|
| 540 |
-
inputs=[
|
| 541 |
-
prompt,
|
| 542 |
-
tts_voice,
|
| 543 |
-
speed,
|
| 544 |
-
output_audio0,
|
| 545 |
-
tts_pitch,
|
| 546 |
-
google_tts_check_box,
|
| 547 |
-
txt_input
|
| 548 |
-
],
|
| 549 |
-
outputs=[tts_voice_audio],
|
| 550 |
-
api_name="text-to-speech"
|
| 551 |
-
)
|
| 552 |
-
convert_button0.click(
|
| 553 |
-
fn=convert_tts,
|
| 554 |
-
inputs=[
|
| 555 |
-
cleaner1,
|
| 556 |
-
autotune3,
|
| 557 |
-
pitch0,
|
| 558 |
-
clean_strength1,
|
| 559 |
-
model_pth0,
|
| 560 |
-
model_index0,
|
| 561 |
-
index_strength0,
|
| 562 |
-
output_audio0,
|
| 563 |
-
output_audio1,
|
| 564 |
-
export_format0,
|
| 565 |
-
method0,
|
| 566 |
-
hybrid_method0,
|
| 567 |
-
hop_length0,
|
| 568 |
-
embedders0,
|
| 569 |
-
custom_embedders0,
|
| 570 |
-
resample_sr0,
|
| 571 |
-
filter_radius0,
|
| 572 |
-
volume_envelope0,
|
| 573 |
-
protect0,
|
| 574 |
-
split_audio0,
|
| 575 |
-
f0_autotune_strength0,
|
| 576 |
-
checkpointing0,
|
| 577 |
-
onnx_f0_mode1,
|
| 578 |
-
formant_shifting1,
|
| 579 |
-
formant_qfrency1,
|
| 580 |
-
formant_timbre1,
|
| 581 |
-
f0_file_dropdown0,
|
| 582 |
-
embed_mode1
|
| 583 |
-
],
|
| 584 |
-
outputs=[tts_voice_convert],
|
| 585 |
-
api_name="convert_tts"
|
| 586 |
-
)
|
| 587 |
-
|
| 588 |
|
| 589 |
|
| 590 |
with gr.TabItem(translations["downloads"], visible=configs.get("downloads_tab", True)):
|
|
@@ -906,151 +462,7 @@ with gr.Blocks(title=" Ultimate RVC Maker ⚡", theme=theme) as app:
|
|
| 906 |
api_name="training_model"
|
| 907 |
)
|
| 908 |
|
| 909 |
-
|
| 910 |
-
gr.Markdown(f"## {translations['convert_with_whisper']}")
|
| 911 |
-
with gr.Row():
|
| 912 |
-
gr.Markdown(translations["convert_with_whisper_info"])
|
| 913 |
-
with gr.Row():
|
| 914 |
-
with gr.Column():
|
| 915 |
-
with gr.Group():
|
| 916 |
-
with gr.Row():
|
| 917 |
-
cleaner2 = gr.Checkbox(label=translations["clear_audio"], value=False, interactive=True)
|
| 918 |
-
autotune2 = gr.Checkbox(label=translations["autotune"], value=False, interactive=True)
|
| 919 |
-
checkpointing2 = gr.Checkbox(label=translations["memory_efficient_training"], value=False, interactive=True)
|
| 920 |
-
formant_shifting2 = gr.Checkbox(label=translations["formantshift"], value=False, interactive=True)
|
| 921 |
-
with gr.Row():
|
| 922 |
-
num_spk = gr.Slider(minimum=2, maximum=8, step=1, info=translations["num_spk_info"], label=translations["num_spk"], value=2, interactive=True)
|
| 923 |
-
with gr.Row():
|
| 924 |
-
with gr.Column():
|
| 925 |
-
convert_button3 = gr.Button(translations["convert_audio"], variant="primary")
|
| 926 |
-
with gr.Row():
|
| 927 |
-
with gr.Column():
|
| 928 |
-
with gr.Accordion(translations["model_accordion"] + " 1", open=True):
|
| 929 |
-
with gr.Row():
|
| 930 |
-
model_pth2 = 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)
|
| 931 |
-
model_index2 = 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)
|
| 932 |
-
with gr.Row():
|
| 933 |
-
refesh2 = gr.Button(translations["refesh"])
|
| 934 |
-
with gr.Row():
|
| 935 |
-
pitch3 = gr.Slider(minimum=-20, maximum=20, step=1, info=translations["pitch_info"], label=translations["pitch"], value=0, interactive=True)
|
| 936 |
-
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 != "")
|
| 937 |
-
with gr.Accordion(translations["input_output"], open=False):
|
| 938 |
-
with gr.Column():
|
| 939 |
-
export_format2 = gr.Radio(label=translations["export_format"], info=translations["export_info"], choices=["wav", "mp3", "flac", "ogg", "opus", "m4a", "mp4", "aac", "alac", "wma", "aiff", "webm", "ac3"], value="wav", interactive=True)
|
| 940 |
-
input_audio1 = gr.Dropdown(label=translations["audio_path"], value="", choices=paths_for_files, info=translations["provide_audio"], allow_custom_value=True, interactive=True)
|
| 941 |
-
output_audio2 = gr.Textbox(label=translations["output_path"], value="audios/output.wav", placeholder="audios/output.wav", info=translations["output_path_info"], interactive=True)
|
| 942 |
-
with gr.Column():
|
| 943 |
-
refesh4 = gr.Button(translations["refesh"])
|
| 944 |
-
with gr.Row():
|
| 945 |
-
input2 = gr.File(label=translations["drop_audio"], file_types=[".wav", ".mp3", ".flac", ".ogg", ".opus", ".m4a", ".mp4", ".aac", ".alac", ".wma", ".aiff", ".webm", ".ac3"])
|
| 946 |
-
with gr.Column():
|
| 947 |
-
with gr.Accordion(translations["model_accordion"] + " 2", open=True):
|
| 948 |
-
with gr.Row():
|
| 949 |
-
model_pth3 = 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)
|
| 950 |
-
model_index3 = 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)
|
| 951 |
-
with gr.Row():
|
| 952 |
-
refesh3 = gr.Button(translations["refesh"])
|
| 953 |
-
with gr.Row():
|
| 954 |
-
pitch4 = gr.Slider(minimum=-20, maximum=20, step=1, info=translations["pitch_info"], label=translations["pitch"], value=0, interactive=True)
|
| 955 |
-
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 != "")
|
| 956 |
-
with gr.Accordion(translations["setting"], open=False):
|
| 957 |
-
with gr.Row():
|
| 958 |
-
model_size = gr.Radio(label=translations["model_size"], info=translations["model_size_info"], choices=["tiny", "tiny.en", "base", "base.en", "small", "small.en", "medium", "medium.en", "large-v1", "large-v2", "large-v3", "large-v3-turbo"], value="medium", interactive=True)
|
| 959 |
-
with gr.Accordion(translations["f0_method"], open=False):
|
| 960 |
-
with gr.Group():
|
| 961 |
-
with gr.Row():
|
| 962 |
-
onnx_f0_mode4 = gr.Checkbox(label=translations["f0_onnx_mode"], info=translations["f0_onnx_mode_info"], value=False, interactive=True)
|
| 963 |
-
unlock_full_method2 = gr.Checkbox(label=translations["f0_unlock"], info=translations["f0_unlock_info"], value=False, interactive=True)
|
| 964 |
-
method3 = gr.Radio(label=translations["f0_method"], info=translations["f0_method_info"], choices=method_f0+["hybrid"], value="rmvpe", interactive=True)
|
| 965 |
-
hybrid_method3 = gr.Dropdown(label=translations["f0_method_hybrid"], info=translations["f0_method_hybrid_info"], choices=["hybrid[pm+dio]", "hybrid[pm+crepe-tiny]", "hybrid[pm+crepe]", "hybrid[pm+fcpe]", "hybrid[pm+rmvpe]", "hybrid[pm+harvest]", "hybrid[pm+yin]", "hybrid[dio+crepe-tiny]", "hybrid[dio+crepe]", "hybrid[dio+fcpe]", "hybrid[dio+rmvpe]", "hybrid[dio+harvest]", "hybrid[dio+yin]", "hybrid[crepe-tiny+crepe]", "hybrid[crepe-tiny+fcpe]", "hybrid[crepe-tiny+rmvpe]", "hybrid[crepe-tiny+harvest]", "hybrid[crepe+fcpe]", "hybrid[crepe+rmvpe]", "hybrid[crepe+harvest]", "hybrid[crepe+yin]", "hybrid[fcpe+rmvpe]", "hybrid[fcpe+harvest]", "hybrid[fcpe+yin]", "hybrid[rmvpe+harvest]", "hybrid[rmvpe+yin]", "hybrid[harvest+yin]"], value="hybrid[pm+dio]", interactive=True, allow_custom_value=True, visible=method3.value == "hybrid")
|
| 966 |
-
hop_length3 = gr.Slider(label="Hop length", info=translations["hop_length_info"], minimum=1, maximum=512, value=128, step=1, interactive=True, visible=False)
|
| 967 |
-
with gr.Accordion(translations["hubert_model"], open=False):
|
| 968 |
-
embed_mode3 = gr.Radio(label=translations["embed_mode"], info=translations["embed_mode_info"], value="fairseq", choices=embedders_mode, interactive=True, visible=True)
|
| 969 |
-
embedders3 = gr.Radio(label=translations["hubert_model"], info=translations["hubert_info"], choices=embedders_model, value="hubert_base", interactive=True)
|
| 970 |
-
custom_embedders3 = gr.Textbox(label=translations["modelname"], info=translations["modelname_info"], value="", placeholder="hubert_base", interactive=True, visible=embedders3.value == "custom")
|
| 971 |
-
with gr.Column():
|
| 972 |
-
clean_strength3 = gr.Slider(label=translations["clean_strength"], info=translations["clean_strength_info"], minimum=0, maximum=1, value=0.5, step=0.1, interactive=True, visible=cleaner2.value)
|
| 973 |
-
f0_autotune_strength3 = 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)
|
| 974 |
-
resample_sr3 = gr.Slider(minimum=0, maximum=96000, label=translations["resample"], info=translations["resample_info"], value=0, step=1, interactive=True)
|
| 975 |
-
filter_radius3 = gr.Slider(minimum=0, maximum=7, label=translations["filter_radius"], info=translations["filter_radius_info"], value=3, step=1, interactive=True)
|
| 976 |
-
volume_envelope3 = gr.Slider(minimum=0, maximum=1, label=translations["volume_envelope"], info=translations["volume_envelope_info"], value=1, step=0.1, interactive=True)
|
| 977 |
-
protect3 = gr.Slider(minimum=0, maximum=1, label=translations["protect"], info=translations["protect_info"], value=0.5, step=0.01, interactive=True)
|
| 978 |
-
with gr.Row():
|
| 979 |
-
formant_qfrency3 = gr.Slider(value=1.0, label=translations["formant_qfrency"] + " 1", info=translations["formant_qfrency"], minimum=0.0, maximum=16.0, step=0.1, interactive=True, visible=False)
|
| 980 |
-
formant_timbre3 = gr.Slider(value=1.0, label=translations["formant_timbre"] + " 1", info=translations["formant_timbre"], minimum=0.0, maximum=16.0, step=0.1, interactive=True, visible=False)
|
| 981 |
-
with gr.Row():
|
| 982 |
-
formant_qfrency4 = gr.Slider(value=1.0, label=translations["formant_qfrency"] + " 2", info=translations["formant_qfrency"], minimum=0.0, maximum=16.0, step=0.1, interactive=True, visible=False)
|
| 983 |
-
formant_timbre4 = gr.Slider(value=1.0, label=translations["formant_timbre"] + " 2", info=translations["formant_timbre"], minimum=0.0, maximum=16.0, step=0.1, interactive=True, visible=False)
|
| 984 |
-
with gr.Row():
|
| 985 |
-
gr.Markdown(translations["input_output"])
|
| 986 |
-
with gr.Row():
|
| 987 |
-
play_audio2 = gr.Audio(show_download_button=True, interactive=False, label=translations["input_audio"])
|
| 988 |
-
play_audio3 = gr.Audio(show_download_button=True, interactive=False, label=translations["output_file_tts_convert"])
|
| 989 |
-
with gr.Row():
|
| 990 |
-
autotune2.change(fn=visible, inputs=[autotune2], outputs=[f0_autotune_strength3])
|
| 991 |
-
cleaner2.change(fn=visible, inputs=[cleaner2], outputs=[clean_strength3])
|
| 992 |
-
method3.change(fn=lambda method, hybrid: [visible(method == "hybrid"), hoplength_show(method, hybrid)], inputs=[method3, hybrid_method3], outputs=[hybrid_method3, hop_length3])
|
| 993 |
-
with gr.Row():
|
| 994 |
-
hybrid_method3.change(fn=hoplength_show, inputs=[method3, hybrid_method3], outputs=[hop_length3])
|
| 995 |
-
refesh2.click(fn=change_models_choices, inputs=[], outputs=[model_pth2, model_index2])
|
| 996 |
-
model_pth2.change(fn=get_index, inputs=[model_pth2], outputs=[model_index2])
|
| 997 |
-
with gr.Row():
|
| 998 |
-
refesh3.click(fn=change_models_choices, inputs=[], outputs=[model_pth3, model_index3])
|
| 999 |
-
model_pth3.change(fn=get_index, inputs=[model_pth3], outputs=[model_index3])
|
| 1000 |
-
input2.upload(fn=lambda audio_in: shutil.move(audio_in.name, os.path.join("audios")), inputs=[input2], outputs=[input_audio1])
|
| 1001 |
-
with gr.Row():
|
| 1002 |
-
input_audio1.change(fn=lambda audio: audio if os.path.isfile(audio) else None, inputs=[input_audio1], outputs=[play_audio2])
|
| 1003 |
-
formant_shifting2.change(fn=lambda a: [visible(a)]*4, inputs=[formant_shifting2], outputs=[formant_qfrency3, formant_timbre3, formant_qfrency4, formant_timbre4])
|
| 1004 |
-
embedders3.change(fn=lambda embedders: visible(embedders == "custom"), inputs=[embedders3], outputs=[custom_embedders3])
|
| 1005 |
-
with gr.Row():
|
| 1006 |
-
refesh4.click(fn=change_audios_choices, inputs=[input_audio1], outputs=[input_audio1])
|
| 1007 |
-
model_index2.change(fn=index_strength_show, inputs=[model_index2], outputs=[index_strength2])
|
| 1008 |
-
model_index3.change(fn=index_strength_show, inputs=[model_index3], outputs=[index_strength3])
|
| 1009 |
-
with gr.Row():
|
| 1010 |
-
unlock_full_method2.change(fn=unlock_f0, inputs=[unlock_full_method2], outputs=[method3])
|
| 1011 |
-
embed_mode3.change(fn=visible_embedders, inputs=[embed_mode3], outputs=[embedders3])
|
| 1012 |
-
convert_button3.click(
|
| 1013 |
-
fn=convert_with_whisper,
|
| 1014 |
-
inputs=[
|
| 1015 |
-
num_spk,
|
| 1016 |
-
model_size,
|
| 1017 |
-
cleaner2,
|
| 1018 |
-
clean_strength3,
|
| 1019 |
-
autotune2,
|
| 1020 |
-
f0_autotune_strength3,
|
| 1021 |
-
checkpointing2,
|
| 1022 |
-
model_pth2,
|
| 1023 |
-
model_pth3,
|
| 1024 |
-
model_index2,
|
| 1025 |
-
model_index3,
|
| 1026 |
-
pitch3,
|
| 1027 |
-
pitch4,
|
| 1028 |
-
index_strength2,
|
| 1029 |
-
index_strength3,
|
| 1030 |
-
export_format2,
|
| 1031 |
-
input_audio1,
|
| 1032 |
-
output_audio2,
|
| 1033 |
-
onnx_f0_mode4,
|
| 1034 |
-
method3,
|
| 1035 |
-
hybrid_method3,
|
| 1036 |
-
hop_length3,
|
| 1037 |
-
embed_mode3,
|
| 1038 |
-
embedders3,
|
| 1039 |
-
custom_embedders3,
|
| 1040 |
-
resample_sr3,
|
| 1041 |
-
filter_radius3,
|
| 1042 |
-
volume_envelope3,
|
| 1043 |
-
protect3,
|
| 1044 |
-
formant_shifting2,
|
| 1045 |
-
formant_qfrency3,
|
| 1046 |
-
formant_timbre3,
|
| 1047 |
-
formant_qfrency4,
|
| 1048 |
-
formant_timbre4,
|
| 1049 |
-
],
|
| 1050 |
-
outputs=[play_audio3],
|
| 1051 |
-
api_name="convert_with_whisper"
|
| 1052 |
-
)
|
| 1053 |
-
|
| 1054 |
|
| 1055 |
with gr.TabItem(translations["audio_editing"], visible=configs.get("audioldm2", True)):
|
| 1056 |
gr.Markdown(translations["audio_editing_info"])
|
|
|
|
| 24 |
|
| 25 |
from time import sleep
|
| 26 |
from multiprocessing import cpu_count
|
| 27 |
+
from main.app.tabs.inference.inference import inference_tabs
|
| 28 |
sys.path.append(os.getcwd())
|
| 29 |
|
| 30 |
from main.tools import huggingface
|
|
|
|
| 139 |
api_name='separator_music'
|
| 140 |
)
|
| 141 |
|
| 142 |
+
with gr.TabItem("Inference"):
|
| 143 |
+
inference_tabs()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 466 |
|
| 467 |
with gr.TabItem(translations["audio_editing"], visible=configs.get("audioldm2", True)):
|
| 468 |
gr.Markdown(translations["audio_editing_info"])
|