Support 2.1NoVQ Onnx and 2.2 NoVQ Onnx

This commit is contained in:
白叶 藤原
2023-12-16 13:25:03 +08:00
parent de73e01926
commit a717d72f49
8 changed files with 1631 additions and 5 deletions

View File

@@ -2,15 +2,18 @@ from utils import get_hparams_from_file, load_checkpoint
import json
def export_onnx(export_path, model_path, config_path):
def export_onnx(export_path, model_path, config_path, novq, dev):
hps = get_hparams_from_file(config_path)
version = hps.version[0:3]
if version == "2.0":
if version == "2.0" or (version == "2.1" and novq):
from .V200 import SynthesizerTrn, symbols
elif version == "2.1":
elif version == "2.1" and (not novq):
from .V210 import SynthesizerTrn, symbols
elif version == "2.2":
from .V220 import SynthesizerTrn, symbols
if novq and dev:
from .V220_novq_dev import SynthesizerTrn, symbols
else:
from .V220 import SynthesizerTrn, symbols
net_g = SynthesizerTrn(
len(symbols),
hps.data.filter_length // 2 + 1,