[BugFix] Fix the issue with stream=True (#2955)
Signed-off-by: amy-why-3459 <wuhaiyan17@huawei.com>
This commit is contained in:
1 parent
de4e47237a
commit
c1ba86ab5b
1 file changed
+3
-4
@@ -118,10 +118,9 @@ class OmniRequestState(RequestState):
|
|||||||
if isinstance(v, list) and v and isinstance(v[0], torch.Tensor):
|
if isinstance(v, list) and v and isinstance(v[0], torch.Tensor):
|
||||||
try:
|
try:
|
||||||
if k == "audio":
|
if k == "audio":
|
||||||
# Concatenate delta audio chunks (1-D) into the full waveform.
|
# When the audio tensor shape is inconsistent, torch.cat will fail.
|
||||||
# Each entry is a per-step slice; flatten to -1 so chunks with
|
# We need to use torch.cat in -1 dimension.
|
||||||
# inconsistent leading dims can still be joined on the sample axis.
|
continue
|
||||||
self.mm_accumulated[k] = torch.cat([t.reshape(-1) for t in v], dim=0)
|
|
||||||
elif k == "sr":
|
elif k == "sr":
|
||||||
# Sample rate is a constant scalar, keep last value.
|
# Sample rate is a constant scalar, keep last value.
|
||||||
self.mm_accumulated[k] = v[-1]
|
self.mm_accumulated[k] = v[-1]
|
||||||
|
|||||||
Reference in new issue
Block a user