[Perf] VoxCPM2: streaming VAE + compile optimization (45% RTF reduction) (#2758)

Signed-off-by: Yueqian Lin <linyueqian@outlook.com>
This commit is contained in:
Yueqian Lin authored and GitHub committed 2026-04-15 09:58:25 +08:00
1 parent 9e46a79c17
commit 02e5dc747d
6 files changed
+716 -79

No files matched your search

+4 -3
View File
@@ -118,9 +118,10 @@ class OmniRequestState(RequestState):
if isinstance(v, list) and v and isinstance(v[0], torch.Tensor):
try:
if k == "audio":
# When the audio tensor shape is inconsistent, torch.cat will fail.
# We need to use torch.cat in -1 dimension.
continue
# Concatenate delta audio chunks (1-D) into the full waveform.
# Each entry is a per-step slice; flatten to -1 so chunks with
# inconsistent leading dims can still be joined on the sample axis.
self.mm_accumulated[k] = torch.cat([t.reshape(-1) for t in v], dim=0)
elif k == "sr":
# Sample rate is a constant scalar, keep last value.
self.mm_accumulated[k] = v[-1]