Fix onnx export & Support TensorRT (#2384)

* Fix Onnx Export And Support TensorRT

* Add files via upload
This commit is contained in:
Ναρουσέ·μ·γιουμεμί·Χινακάννα
2024-11-24 00:27:28 +08:00
committed by GitHub
parent 9ae3af4a7d
commit 1376ce739d
3 changed files with 454 additions and 3 deletions

View File

@@ -2,7 +2,6 @@ import torch
from infer.lib.infer_pack.models_onnx import SynthesizerTrnMsNSFsidM
def export_onnx(ModelPath, ExportedPath):
cpt = torch.load(ModelPath, map_location="cpu")
cpt["config"][-3] = cpt["weight"]["emb_g.weight"].shape[0]
@@ -44,7 +43,7 @@ def export_onnx(ModelPath, ExportedPath):
"rnd": [2],
},
do_constant_folding=False,
opset_version=13,
opset_version=18,
verbose=False,
input_names=input_names,
output_names=output_names,