From 753f5f16032b0a9858afad1c86fc701e7faa2a07 Mon Sep 17 00:00:00 2001 From: afpro Date: Thu, 27 Jun 2024 21:36:58 +0800 Subject: [PATCH] fix: _encode_spk_emb use 'tobytes' without check 'dtype' (#480) --- ChatTTS/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChatTTS/core.py b/ChatTTS/core.py index 3d668262a..31433e9a6 100644 --- a/ChatTTS/core.py +++ b/ChatTTS/core.py @@ -162,7 +162,7 @@ def sample_random_speaker(self) -> str: @staticmethod def _encode_spk_emb(spk_emb: torch.Tensor) -> str: with torch.no_grad(): - arr: np.ndarray = spk_emb.cpu().numpy() + arr: np.ndarray = spk_emb.to(dtype=torch.float16, device='cpu').numpy() s = b14.encode_to_string( lzma.compress( arr.tobytes(),