Skip to content

Commit

Permalink
fix: ensure SpkEncoder tensor with dtype.float
Browse files Browse the repository at this point in the history
  • Loading branch information
zhzLuke96 committed Jul 26, 2024
1 parent 3ce2424 commit b9491a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/core/spk/TTSSpeaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DcSpkEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, torch.Tensor):
# token 会触发这里
arr_bytes = obj.cpu().detach().numpy().tobytes()
arr_bytes = obj.cpu().float().detach().numpy().tobytes()
return {
"_type": "torch.Tensor",
"data": base64.b64encode(arr_bytes).decode("utf-8"),
Expand Down

0 comments on commit b9491a6

Please sign in to comment.