(self, tokens)
| 127 | return bpe_tokens |
| 128 | |
| 129 | def decode(self, tokens): |
| 130 | text = ''.join([self.decoder[token] for token in tokens]) |
| 131 | text = bytearray([self.byte_decoder[c] for c in text]).decode('utf-8', errors="replace").replace('</w>', ' ') |
| 132 | return text |