Skip to content

Commit 46dfe04

Browse files
committed
fix possible bug
1 parent 6385656 commit 46dfe04

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cosyvoice/flow/flow_matching.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ def forward_estimator(self, x, mask, mu, t, spks, cond, streaming=False):
127127
return self.estimator(x, mask, mu, t, spks, cond, streaming=streaming)
128128
else:
129129
[estimator, stream], trt_engine = self.estimator.acquire_estimator()
130+
# NOTE need to synchronize when switching stream
131+
torch.cuda.current_stream().synchronize()
130132
with stream:
131133
estimator.set_input_shape('x', (2, 80, x.size(2)))
132134
estimator.set_input_shape('mask', (2, 1, x.size(2)))

0 commit comments

Comments
 (0)