mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 18:22:34 +06:00
🐛 #2096 in tokenizer.decode, adds a space after special tokens to return right formatted string
This commit is contained in:
parent
866d73ca26
commit
5b7b78e088
@ -1180,7 +1180,7 @@ class PreTrainedTokenizer(object):
|
||||
if current_sub_text:
|
||||
sub_texts.append(self.convert_tokens_to_string(current_sub_text))
|
||||
current_sub_text = []
|
||||
sub_texts.append(" " + token)
|
||||
sub_texts.append(" " + token + " ")
|
||||
else:
|
||||
current_sub_text.append(token)
|
||||
if current_sub_text:
|
||||
|
Loading…
Reference in New Issue
Block a user