Skip to content

Commit 56201d2

Browse files
author
NeoDev
authored
Update inference.py
1 parent 549fcdb commit 56201d2

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

tabs/inference/inference.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,11 @@ def run_advanced_rvc(model_name, youtube_url, export_format, f0_method, f0_up_ke
300300
final_mix = final_mix.overlay(backing_vocals_audio)
301301

302302
# Save the final mix
303-
output_filename = f"aicover_{model_name}_opt"
303+
output_filename = f"aicover_{model_name}"
304304
output_file = f"{output_filename}.{export_format.lower()}"
305305
final_mix.export(output_file, format=export_format.lower())
306306
logging.info("Mixed file saved as: %s", output_file)
307-
return f"Mixed file saved as: {output_file}", output_file
307+
return f"Mixed file saved as: {output_file}", output_file, lead_vocals_audio, backing_vocals_audio
308308
except Exception as e:
309309
logging.exception("An error occurred during execution: %s", e)
310310
return f"An error occurred: {e}", None
@@ -320,6 +320,7 @@ def inference_tab():
320320
model_name_input = gr.Textbox(label="Model Name", value="Sonic")
321321
youtube_url_input = gr.Textbox(label="YouTube URL", value="https://youtu.be/eCkWlRL3_N0?si=y6xHAs1m8fYVLTUV")
322322
export_format_input = gr.Dropdown(label="Export Format", choices=["WAV", "MP3", "FLAC", "OGG", "M4A"], value="WAV")
323+
323324
f0_method_input = gr.Dropdown(label="F0 Method", choices=["crepe", "crepe-tiny", "rmvpe", "fcpe", "hybrid[rmvpe+fcpe]"],
324325
value="hybrid[rmvpe+fcpe]")
325326
with gr.Row():
@@ -330,9 +331,9 @@ def inference_tab():
330331
with gr.Row():
331332
index_rate_input = gr.Slider(label="Index Rate", minimum=0.0, maximum=1.0, step=0.1, value=0.6)
332333
hop_length_input = gr.Slider(label="Hop Length", minimum=1, maximum=512, step=1, value=128)
333-
clean_strength_input = gr.Slider(label="Clean Strength", minimum=0.0, maximum=1.0, step=0.1, value=0.7)
334-
with gr.Row():
334+
clean_strength_input = gr.Slider(label="Clean Strength", minimum=0.0, maximum=1.0, step=0.1, value=0.7)
335335
split_audio_input = gr.Checkbox(label="Split Audio", value=False)
336+
with gr.Row():
336337
clean_audio_input = gr.Checkbox(label="Clean Audio", value=False)
337338
f0_autotune_input = gr.Checkbox(label="F0 Autotune", value=False)
338339
backing_vocal_infer_input = gr.Checkbox(label="Infer Backing Vocals", value=False)
@@ -343,9 +344,13 @@ def inference_tab():
343344
value="contentvec"
344345
)
345346
embedder_model_custom_input = gr.Textbox(label="Custom Embedder Model", value="")
346-
run_button = gr.Button("Run Advanced RVC Pipeline")
347-
output_message = gr.Textbox(label="Status")
348-
output_audio = gr.Audio(label="Final Mixed Audio", type="filepath")
347+
run_button = gr.Button("Convert")
348+
with gr.Row():
349+
output_message = gr.Textbox(label="Status")
350+
output_audio = gr.Audio(label="Final Mixed Audio", type="filepath")
351+
with gr.Row():
352+
output_lead = gr.Audio(label="Output Lead Ai Cover:", type="filepath")
353+
output_backing = gr.Audio(label="Output Backing Ai Cover:", type="filepath")
349354

350355
run_button.click(
351356
run_advanced_rvc,
@@ -356,5 +361,5 @@ def inference_tab():
356361
clean_audio_input, f0_autotune_input, backing_vocal_infer_input,
357362
embedder_model_input, embedder_model_custom_input
358363
],
359-
outputs=[output_message, output_audio]
364+
outputs=[output_message, output_audio, output_lead, output_backing]
360365
)

0 commit comments

Comments
 (0)