Skip to content

Commit 3a79d81

Browse files
committed
fix(rtrvc): parameter issue
1 parent 0d5cd34 commit 3a79d81

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

infer/lib/rtrvc.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,7 @@ def infer(
213213
pitch, pitchf = self._get_f0(
214214
input_wav[-f0_extractor_frame:],
215215
self.f0_up_key - self.formant_shift,
216-
3,
217-
f0method,
216+
method=f0method,
218217
)
219218
shift = block_frame_16k // self.window
220219
self.cache_pitch[:-shift] = self.cache_pitch[shift:].clone()
@@ -297,7 +296,7 @@ def _get_f0_post(self, f0, f0_up_key):
297296
def _get_f0_pm(self, x, f0_up_key, filter_radius):
298297
if not hasattr(self, "pm"):
299298
self.pm = PM(hop_length=160, sampling_rate=16000)
300-
f0 = self.pm.compute_f0(x)
299+
f0 = self.pm.compute_f0(x.cpu().numpy())
301300
return self._get_f0_post(f0, f0_up_key)
302301

303302
def _get_f0_harvest(self, x, f0_up_key, filter_radius=3):
@@ -309,7 +308,7 @@ def _get_f0_harvest(self, x, f0_up_key, filter_radius=3):
309308
self.sr,
310309
)
311310
if filter_radius is None: filter_radius=3
312-
f0 = self.harvest.compute_f0(x, filter_radius=filter_radius)
311+
f0 = self.harvest.compute_f0(x.cpu().numpy(), filter_radius=filter_radius)
313312
return self._get_f0_post(f0, f0_up_key)
314313

315314
def _get_f0_dio(self, x, f0_up_key, filter_radius):
@@ -320,7 +319,7 @@ def _get_f0_dio(self, x, f0_up_key, filter_radius):
320319
self.f0_max,
321320
self.sr,
322321
)
323-
f0 = self.dio.compute_f0(x)
322+
f0 = self.dio.compute_f0(x.cpu().numpy())
324323
return self._get_f0_post(f0, f0_up_key)
325324

326325
def _get_f0_crepe(self, x, f0_up_key, filter_radius):

rvc/layers/synthesizers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def infer(
188188
flow_head = head - 24
189189
if flow_head < 0: flow_head = 0
190190
dec_head = head - flow_head
191-
m_p, logs_p, x_mask = self.enc_p(phone, pitch, phone_lengths, head)
191+
m_p, logs_p, x_mask = self.enc_p(phone, pitch, phone_lengths, flow_head)
192192
z_p = (m_p + torch.exp(logs_p) * torch.randn_like(m_p) * 0.66666) * x_mask
193193
z = self.flow(z_p, x_mask, g=g, reverse=True)
194194
z = z[:, :, dec_head : dec_head + length]

0 commit comments

Comments
 (0)