Support Qwen3 tts online serving (#968)
Signed-off-by: linyueqian <linyueqian@outlook.com>
This commit is contained in:
1 parent
4a3a1b6de8
commit
77ff875170
8 files changed
+772
-21
No files matched your search
@@ -82,7 +82,11 @@ class OmniMsgpackEncoder:
|
||||
|
||||
def _encode_tensor(self, tensor: torch.Tensor) -> dict[str, Any]:
|
||||
"""Encode torch.Tensor to dict."""
|
||||
t = tensor.detach().contiguous().cpu().view(torch.uint8)
|
||||
t = tensor.detach().contiguous().cpu()
|
||||
# Handle 0-dimensional (scalar) tensors by reshaping to 1D first
|
||||
if t.dim() == 0:
|
||||
t = t.reshape(1)
|
||||
t = t.view(torch.uint8)
|
||||
return {
|
||||
_TENSOR_MARKER: True,
|
||||
"dtype": str(tensor.dtype).removeprefix("torch."),
|
||||
|
||||
Reference in new issue
Block a user