[Bugfix][MiniCPM-o][NPU] Skip Code2Wav dynamo unwrap when flow.encode… (#6397)

Signed-off-by: amy-why-3459 <wuhaiyan17@huawei.com>
This commit is contained in:
amy-why-3459 authored and GitHub committed 2026-08-20 16:24:08 +08:00
1 parent 53df9fe62b
commit 48e4f6a385
1 file changed
+3 -1
@@ -160,7 +160,9 @@ class BatchedToken2Wav(nn.Module):
self._trt_stepper = trt_stepper
self.flow = token2wav.flow
self.hift = token2wav.hift
_undecorate_dynamo(self.flow.encoder, "forward_chunk")
encoder = getattr(self.flow, "encoder", None)
if encoder is not None:
_undecorate_dynamo(encoder, "forward_chunk")
hift_parameter = next(self.hift.parameters(), None)
if hift_parameter is not None and hift_parameter.device.type == "cuda":
# Prime the CUDA state used by HiFT during backend construction.