Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
NaruseMioShirakana authored Feb 28, 2023
1 parent b86793b commit 0bdc2ef
Show file tree
Hide file tree
Showing 4 changed files with 1,103 additions and 0 deletions.
22 changes: 22 additions & 0 deletions emotional_vits_onnx_export.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import emotional_vits_onnx_model
import utils
import torch
import commons

hps = utils.get_hparams_from_file("nene.json")
net_g = emotional_vits_onnx_model.SynthesizerTrn(
40,
hps.data.filter_length // 2 + 1,
hps.train.segment_size // hps.data.hop_length,
n_speakers=hps.data.n_speakers,
**hps.model)
_ = net_g.eval()
_ = utils.load_checkpoint("nene.pth", net_g)

stn_tst = torch.LongTensor([0,20,0,21,0,22,0])
with torch.no_grad():
x_tst = stn_tst.unsqueeze(0)
x_tst_lengths = torch.LongTensor([stn_tst.size(0)])
sid = torch.tensor([0])
emo = torch.randn(1024)
o = net_g(x_tst, x_tst_lengths, sid=sid, emo=emo)
Loading

0 comments on commit 0bdc2ef

Please sign in to comment.