Spaces:
Running
Running
Update src/main.py
Browse files42 unmodified lines434445464748496 unmodified lines565758596061626364656667686915 unmodified lines85868788899042 unmodified linesdef display_progress(percent, message, progress=gr.Progress()):progress(percent, desc=message)def voice_change(voice_model, vocals_path, output_path, pitch_change, f0_method, index_rate, filter_radius, rms_mix_rate, protect, crepe_hop_length):rvc_model_path, rvc_index_path = get_rvc_model(voice_model)if torch.cuda.is_available():6 unmodified linescpt, version, net_g, tgt_sr, vc = get_vc(device, config.is_half, config, rvc_model_path)rvc_infer(rvc_index_path, index_rate, vocals_path, output_path, pitch_change, f0_method, cpt, version, net_g,filter_radius, tgt_sr, rms_mix_rate, protect, crepe_hop_length, vc, hubert_model)del hubert_model, cpt, net_g, vcgc.collect()torch.cuda.empty_cache()def song_cover_pipeline(uploaded_file, voice_model, pitch_change, index_rate=0.5, filter_radius=3, rms_mix_rate=0.25, f0_method='rmvpe',crepe_hop_length=128, protect=0.33, output_format='mp3', progress=gr.Progress()):if not uploaded_file or not voice_model:raise ValueError('Make sure that the song input field and voice model field are filled in.')15 unmodified linesdisplay_progress(0.5, '[~] Converting vocals...', progress)voice_change(voice_model, orig_song_path, ai_cover_path, pitch_change, f0_method, index_rate,filter_radius, rms_mix_rate, protect, crepe_hop_length)return ai_cover_path42 unmodified lines434445464748496 unmodified lines565758596061626364656667686915 unmodified lines85868788899042 unmodified linesdef display_progress(percent, message, progress=gr.Progress()):progress(percent, desc=message)def voice_change(voice_model, vocals_path, output_path, pitch_change, f0_method, index_rate, filter_radius, rms_mix_rate, protect, crepe_hop_length, f0_min, f0_max):rvc_model_path, rvc_index_path = get_rvc_model(voice_model)if torch.cuda.is_available():6 unmodified linescpt, version, net_g, tgt_sr, vc = get_vc(device, config.is_half, config, rvc_model_path)rvc_infer(rvc_index_path, index_rate, vocals_path, output_path, pitch_change, f0_method, cpt, version, net_g,filter_radius, tgt_sr, rms_mix_rate, protect, crepe_hop_length, vc, hubert_model, f0_min, f0_max)del hubert_model, cpt, net_g, vcgc.collect()torch.cuda.empty_cache()def song_cover_pipeline(uploaded_file, voice_model, pitch_change, index_rate=0.5, filter_radius=3, rms_mix_rate=0.25, f0_method='rmvpe',crepe_hop_length=128, protect=0.33, output_format='mp3', progress=gr.Progress(), f0_min=50, f0_max=1100):if not uploaded_file or not voice_model:raise ValueError('Make sure that the song input field and voice model field are filled in.')15 unmodified linesdisplay_progress(0.5, '[~] Converting vocals...', progress)voice_change(voice_model, orig_song_path, ai_cover_path, pitch_change, f0_method, index_rate,filter_radius, rms_mix_rate, protect, crepe_hop_length, f0_min, f0_max)return ai_cover_path
src/main.py+4-4