Skip to content

Commit

Permalink
Update infer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Stardust-minus authored Nov 25, 2023
1 parent 3ec1b65 commit 64e5746
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def infer(
ja_bert = ja_bert.to(device).unsqueeze(0)
en_bert = en_bert.to(device).unsqueeze(0)
x_tst_lengths = torch.LongTensor([phones.size(0)]).to(device)
emo = emo.to(device).unsqueeze(0)
del phones
speakers = torch.LongTensor([hps.data.spk2id[sid]]).to(device)
audio = (
Expand All @@ -228,6 +229,7 @@ def infer(
bert,
ja_bert,
en_bert,
emo,
sdp_ratio=sdp_ratio,
noise_scale=noise_scale,
noise_scale_w=noise_scale_w,
Expand All @@ -237,7 +239,7 @@ def infer(
.float()
.numpy()
)
del x_tst, tones, lang_ids, bert, x_tst_lengths, speakers, ja_bert, en_bert
del x_tst, tones, lang_ids, bert, x_tst_lengths, speakers, ja_bert, en_bert, emo
if torch.cuda.is_available():
torch.cuda.empty_cache()
return audio
Expand Down

0 comments on commit 64e5746

Please sign in to comment.