Skip to content

Commit

Permalink
fix(dvae): given NumPy array is not writable (2noise#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama authored Jun 22, 2024
1 parent 98bf2c3 commit 7fecdb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ChatTTS/model/dvae.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7fecdb8

Please sign in to comment.