Browse Source

set use_flow_cache=True when export

lyuxiang.lx 7 months ago
parent
commit
7902d1c17f
2 changed files with 4 additions and 2 deletions
  1. 2 1
      cosyvoice/bin/export_jit.py
  2. 2 1
      cosyvoice/bin/export_onnx.py

+ 2 - 1
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!')
 

+ 2 - 1
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!')