Spaces:
Running
Running
Update src/main.py
Browse files42 unmodified lines43444546464748496 unmodified lines5657585959606162636465666667686915 unmodified lines8586878888899042 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):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 lines cpt, 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) filter_radius, tgt_sr, rms_mix_rate, protect, crepe_hop_length, vc, hubert_model, f0_min, f0_max) del hubert_model, cpt, net_g, vc gc.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()): 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 lines
display_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) filter_radius, rms_mix_rate, protect, crepe_hop_length, f0_min, f0_max)
return ai_cover_pathsrc/main.py+4-4