Spaces:
Running
Running
Update src/covergen.py
Browse files86 unmodified lines87888990919215 unmodified lines10810911011111211311411511611711815 unmodified lines13413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117286 unmodified linesreturn vocals, inst# Define the Gradio interface15 unmodified lineswith gr.Tab("πΆ Voice Conversion"):with gr.Column():audio_input = gr.Audio(label='π΅ Upload Audio', interactive=True, type="filepath")with gr.Accordion('βοΈ Voice Conversion Settings', open=False):use_hybrid_methods = gr.Checkbox(label="𧬠Use Hybrid Methods", value=False)f0_method = gr.Dropdown(['rmvpe+', 'fcpe', 'rmvpe', 'mangio-crepe', 'crepe'], value='rmvpe+', label='π§ F0 Method')15 unmodified linesgenerate_btn.click(song_cover_pipeline, inputs=[audio_input, rvc_model, pitch, f0_method, crepe_hop_length, index_rate, filter_radius, rms_mix_rate, protect, output_format], outputs=[converted_audio])# UVR tabwith gr.Tab(" π§ Vocal Separator (UVR)"):gr.Markdown("β Separate vocals and instruments from an audio file using UVR models.")with gr.Accordion("π Separation by Link", open=False):with gr.Row():mdx23c_link = gr.Textbox(label="π Link",placeholder="π Paste the link here",interactive=True)with gr.Row():gr.Markdown("π‘ You can paste the link to the video/audio from many sites, check the complete list [here](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md)")with gr.Row():mdx23c_download_button = gr.Button("β¬οΈ Download!",variant="primary")uvr5_audio_file = gr.Audio(label=" π² Audio File",type="filepath")with gr.Row():uvr5_model = gr.Dropdown(label="γ½οΈ Model", choices=[model["model_name"] for model in UVR_5_MODELS])uvr5_button = gr.Button("π§ Separate Vocals", variant="primary",)uvr5_output_voc = gr.Audio(type="filepath", label="Output 1",)uvr5_output_inst = gr.Audio(type="filepath", label="Output 2",)mdx23c_download_button.click(download_audio, [mdx23c_link], [uvr5_audio_file])uvr5_button.click(inference, [uvr5_audio_file, uvr5_model], [uvr5_output_voc, uvr5_output_inst])86 unmodified lines8788899091929394959697989910010110210310410510615 unmodified lines12212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815915 unmodified lines17517617717817918018186 unmodified linesreturn vocals, inst# Sample processing functions for audio and text inputsdef process_audio(audio_path):return f"Audio file received: {audio_path}"def process_text(text_input):return f"Text received: {text_input}"# Function to handle input type dynamicallydef dynamic_input(input_type):if input_type == "Audio Upload":return gr.Audio(label='π΅ Upload Audio', interactive=True, type="filepath")else:return gr.Textbox(label="π Enter Text", placeholder="Type your text here...", interactive=True)# Define the Gradio interface15 unmodified lineswith gr.Tab("πΆ Voice Conversion"):with gr.Column():audio_input = gr.Audio(label='π΅ Upload Audio', interactive=True, type="filepath")with gr.Accordion(" π§ Vocal Separator (UVR)"):gr.Markdown("β Separate vocals and instruments from an audio file using UVR models.")with gr.Accordion("π Separation by Link", open=False):with gr.Row():mdx23c_link = gr.Textbox(label="π Link",placeholder="π Paste the link here",interactive=True)with gr.Row():gr.Markdown("π‘ You can paste the link to the video/audio from many sites, check the complete list [here](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md)")with gr.Row():mdx23c_download_button = gr.Button("β¬οΈ Download!",variant="primary")uvr5_audio_file = gr.Audio(label=" π² Audio File",type="filepath")with gr.Row():uvr5_model = gr.Dropdown(label="γ½οΈ Model", choices=[model["model_name"] for model in UVR_5_MODELS])uvr5_button = gr.Button("π§ Separate Vocals", variant="primary")uvr5_output_inst = gr.Audio(type="filepath", label="Output 2",)mdx23c_download_button.click(download_audio, [mdx23c_link], [uvr5_audio_file])uvr5_button.click(inference, [uvr5_audio_file, uvr5_model], [audio_input, uvr5_output_inst])with gr.Accordion('βοΈ Voice Conversion Settings', open=False):use_hybrid_methods = gr.Checkbox(label="𧬠Use Hybrid Methods", value=False)f0_method = gr.Dropdown(['rmvpe+', 'fcpe', 'rmvpe', 'mangio-crepe', 'crepe'], value='rmvpe+', label='π§ F0 Method')15 unmodified linesgenerate_btn.click(song_cover_pipeline, inputs=[audio_input, rvc_model, pitch, f0_method, crepe_hop_length, index_rate, filter_radius, rms_mix_rate, protect, output_format], outputs=[converted_audio])
src/covergen.py+44-35