SupportVer230OnnxExport

This commit is contained in:
白叶 藤原
2023-12-19 23:37:12 +08:00
parent 67751fe874
commit c73778aa4a
8 changed files with 1647 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
import numpy as np
import numpy as np
import onnxruntime as ort
@@ -57,6 +57,13 @@ class OnnxInferenceSession:
length_scale=1.0,
sdp_ratio=0.0,
):
if seq.ndim == 1:
seq = np.expand_dims(seq, 0)
if tone.ndim == 1:
tone = np.expand_dims(tone, 0)
if language.ndim == 1:
language = np.expand_dims(language, 0)
assert(seq.ndim == 2,tone.ndim == 2,language.ndim == 2)
g = self.emb_g.run(
None,
{