From 46dfe0439b29aa342c7d813aaf44efb51a574a16 Mon Sep 17 00:00:00 2001 From: "lyuxiang.lx" Date: Wed, 25 Jun 2025 14:31:05 +0800 Subject: [PATCH] fix possible bug --- cosyvoice/flow/flow_matching.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cosyvoice/flow/flow_matching.py b/cosyvoice/flow/flow_matching.py index 39b3415..7f92df5 100644 --- a/cosyvoice/flow/flow_matching.py +++ b/cosyvoice/flow/flow_matching.py @@ -127,6 +127,8 @@ class ConditionalCFM(BASECFM): return self.estimator(x, mask, mu, t, spks, cond, streaming=streaming) else: [estimator, stream], trt_engine = self.estimator.acquire_estimator() + # NOTE need to synchronize when switching stream + torch.cuda.current_stream().synchronize() with stream: estimator.set_input_shape('x', (2, 80, x.size(2))) estimator.set_input_shape('mask', (2, 1, x.size(2)))