Converts a sequence of tokens (string) in a single string. The most simple way to do it is ' '.join(self.convert_ids_to_tokens(token_ids)) but we often want to remove sub-word tokenization artifacts at the same time.
(self, tokens: List[str])
| 676 | raise NotImplementedError |
| 677 | |
| 678 | def convert_tokens_to_string(self, tokens: List[str]) -> str: |
| 679 | """ Converts a sequence of tokens (string) in a single string. |
| 680 | The most simple way to do it is ' '.join(self.convert_ids_to_tokens(token_ids)) |
| 681 | but we often want to remove sub-word tokenization artifacts at the same time. |
| 682 | """ |
| 683 | return " ".join(self.convert_ids_to_tokens(tokens)) |
| 684 | |
| 685 | def decode( |
| 686 | self, token_ids: List[int], skip_special_tokens: bool = False, clean_up_tokenization_spaces: bool = True |
no test coverage detected