Add files via upload

This commit is contained in:
liujing04
2023-04-13 23:57:27 +08:00
committed by GitHub
parent 605fbe118d
commit a36ff01be1
7 changed files with 38 additions and 34 deletions

View File

@@ -1,5 +1,5 @@
import os,sys,traceback
device=sys.argv[1]
# device=sys.argv[1]
n_part=int(sys.argv[2])
i_part=int(sys.argv[3])
if len(sys.argv) == 5:
@@ -14,6 +14,7 @@ import torch.nn.functional as F
import soundfile as sf
import numpy as np
from fairseq import checkpoint_utils
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
f = open("%s/extract_f0_feature.log"%exp_dir, "a+")
def printt(strr):
@@ -48,7 +49,7 @@ models, saved_cfg, task = checkpoint_utils.load_model_ensemble_and_task(
)
model = models[0]
model = model.to(device)
printt("move model to "+device)
printt("move model to %s"%device)
if device != "cpu": model = model.half()
model.eval()