Update 3-get-semantic.py

This commit is contained in:
RVC-Boss 2024-01-25 23:28:16 +08:00 committed by GitHub
parent 9b0d8599ab
commit 8ce8f85ad9

View File

@ -38,7 +38,12 @@ semantic_path = "%s/6-name2semantic-%s.tsv" % (opt_dir, i_part)
if os.path.exists(semantic_path) == False:
os.makedirs(opt_dir, exist_ok=True)
device = "cuda:0" if torch.cuda.is_available() else "mps"
if torch.cuda.is_available():
device = "cuda"
elif torch.backends.mps.is_available():
device = "mps"
else:
device = "cpu"
hps = utils.get_hparams_from_file(s2config_path)
vq_model = SynthesizerTrn(
hps.data.filter_length // 2 + 1,