From 7902d1c17f0d9f201a8b0e2727ff048b3f99f21c Mon Sep 17 00:00:00 2001 From: "lyuxiang.lx" Date: Mon, 7 Apr 2025 22:27:17 +0800 Subject: [PATCH] set use_flow_cache=True when export --- cosyvoice/bin/export_jit.py | 3 ++- cosyvoice/bin/export_onnx.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cosyvoice/bin/export_jit.py b/cosyvoice/bin/export_jit.py index 4733581..1e89005 100644 --- a/cosyvoice/bin/export_jit.py +++ b/cosyvoice/bin/export_jit.py @@ -61,7 +61,8 @@ def main(): model = CosyVoice(args.model_dir) except Exception: try: - model = CosyVoice2(args.model_dir) + # NOTE set use_flow_cache=True when export jit for cache inference + model = CosyVoice2(args.model_dir, use_flow_cache=True) except Exception: raise TypeError('no valid model_type!') diff --git a/cosyvoice/bin/export_onnx.py b/cosyvoice/bin/export_onnx.py index f03dafb..310f2c1 100644 --- a/cosyvoice/bin/export_onnx.py +++ b/cosyvoice/bin/export_onnx.py @@ -62,7 +62,8 @@ def main(): model = CosyVoice(args.model_dir) except Exception: try: - model = CosyVoice2(args.model_dir) + # NOTE set use_flow_cache=True when export jit for cache inference + model = CosyVoice2(args.model_dir, use_flow_cache=True) except Exception: raise TypeError('no valid model_type!')