Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
asr-aditya opened this issue Oct 14, 2024 · 1 comment
Open

Comments

@asr-aditya
Copy link

asr-aditya commented Oct 14, 2024

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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants