From aea84bfdd001c6aef7ecc94a948fb1ccf05f2195 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: Mon, 8 Jul 2024 17:57:40 +0900 Subject: [PATCH] feat(tokenizer): use encode_plus instead of __call__ --- ChatTTS/model/tokenizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChatTTS/model/tokenizer.py b/ChatTTS/model/tokenizer.py index 78ed3aefb..5fa430152 100644 --- a/ChatTTS/model/tokenizer.py +++ b/ChatTTS/model/tokenizer.py @@ -34,7 +34,7 @@ def encode( max_attention_mask_len = -1 # avoid random speaker embedding of tokenizer in the other dims for t in text: - x = self._tokenizer( + x = self._tokenizer.encode_plus( t, return_tensors="pt", add_special_tokens=False, padding=True ) input_ids_lst.append(x["input_ids"].squeeze_(0))