mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-03 03:31:05 +06:00
strip decoded outputs
This commit is contained in:
parent
01a3966bc6
commit
850da1cc36
@ -228,5 +228,5 @@ class OpenAIGPTTokenizer(object):
|
||||
def decode(self, ids, skip_special_tokens=False):
|
||||
"""Converts a sequence of ids in a string."""
|
||||
tokens = self.convert_ids_to_tokens(ids, skip_special_tokens=skip_special_tokens)
|
||||
out_string = ''.join(tokens).replace('</w>', ' ')
|
||||
out_string = ''.join(tokens).replace('</w>', ' ').strip()
|
||||
return out_string
|
||||
|
Loading…
Reference in New Issue
Block a user