From 7fecdb865729dd376ac7ffa204b98d1f86631782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Sun, 23 Jun 2024 00:06:54 +0900 Subject: [PATCH] fix(dvae): given NumPy array is not writable (#409) --- ChatTTS/model/dvae.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChatTTS/model/dvae.py b/ChatTTS/model/dvae.py index 0fe51f495..8e22304b7 100644 --- a/ChatTTS/model/dvae.py +++ b/ChatTTS/model/dvae.py @@ -150,7 +150,7 @@ def __init__( if coef is None: coef = torch.rand(100) else: - coef = torch.from_numpy(np.frombuffer(b14.decode_from_string(coef), dtype=np.float32)) + coef = torch.from_numpy(np.copy(np.frombuffer(b14.decode_from_string(coef), dtype=np.float32))) self.register_buffer('coef', coef.unsqueeze(0).unsqueeze_(2)) self.decoder = DVAEDecoder(**decoder_config)