INNER CODE UNIT · Python
__init__
voicepaw/so-vits-svc-fork · src/so_vits_svc_fork/inference/core.py:93
def __init__(
self,
*,
net_g_path: Path | str,
config_path: Path | str,
device: torch.device | str | None = None,
cluster_model_path: Path | str | None = None,
half: bool = False,
):
self.net_g_path = net_g_path
if device is None:
self.device = (get_optimal_device(),)
else:
self.device = torch.device(device)
self.hps = utils.get_hparams(config_path)
self.target_sample = self.hps.data.sampling_rate
self.hop_size = self.hps.data.hop_length
self.spk2id = self.hps.spk