RVC-Project / Retrieval-based-Voice-Conversion

in preparation...
MIT License
277 stars 45 forks source link

TypeError: VC.pipeline() got multiple values for argument 'f0_file' #46

Open asr-aditya opened 2 days ago

asr-aditya commented 2 days ago

I am trying to run VoiceConversionWebUI/myinfer-v2-0528.py for inference but am facing multiple argument error. Why are we passing so many parameters to vc.pipeline when it only has 7 defined inputs?

audio_opt=vc.pipeline(hubert_model,net_g,sid,audio,input_audio,times,f0_up_key,f0_method,file_index,index_rate,if_f0,filter_radius,tgt_sr,resample_sr,rms_mix_rate,version,protect,f0_file=f0_file)
 def pipeline(self,model,net_g,dv,audio,times,f0_up_key,f0_file=None):
        audio_pad = np.pad(audio, (self.window // 2, self.window // 2), mode='reflect')
        opt_ts = []
        if(audio_pad.shape[0]>self.t_max):
            audio_sum = np.zeros_like(audio)
            for i in range(self.window): audio_sum += audio_pad[i:i - self.window]
            for t in range(self.t_center, audio.shape[0],self.t_center):opt_ts.append(t - self.t_query + np.where(np.abs(audio_sum[t - self.t_query:t + self.t_query]) == np.abs(audio_sum[t - self.t_query:t + self.t_query]).min())[0][0])
        s = 0
        audio_opt=[]
        .......
        .......

Error

TypeError: VC.pipeline() got multiple values for argument 'f0_file'

Screenshot 2024-10-14 at 11 37 51 PM
alcoftTAO commented 2 days ago

In your code you're passing the positional parameters, then you're changing some by using a keyword, this creates a conflict.

Here's my fixed version:

audio_opt=vc.pipeline(hubert_model,net_g,sid,audio,input_audio,times,f0_up_key,f0_method,file_index,index_rate,if_f0,filter_radius,tgt_sr,resample_sr,rms_mix_rate,version,protect,f0_file)

I replaced f0_file=f0_file with f0_file. This should work, if it doesn't works feel free to post a comment here.