INNER CODE UNIT · Python
f0
voicepaw/so-vits-svc-fork · src/so_vits_svc_fork/inference/core.py:148
f0 = f0 * 2 ** (tran / 12)
f0 = f0.unsqueeze(0)
uv = uv.unsqueeze(0)
c = utils.get_content(
self.hubert_model,
audio,
self.device,
self.target_sample,
self.contentvec_final_proj,
).to(self.dtype)
c = utils.repeat_expand_2d(c.squeeze(0), f0.shape[1])
if cluster_infer_ratio != 0:
cluster_c = cluster.get_cluster_center_result(self.cluster_model, c.cpu().numpy().T, speaker).T
cluster_c = torch.FloatTensor(cluster_c).to(self.device)
c = cluster_infer_ratio * cluster_c + (1 - cluster_infer_ratio) * c