(self, tokens)
| 219 | return bpe_tokens |
| 220 | |
| 221 | def decode(self, tokens): |
| 222 | text = ''.join([self.decoder[token] for token in tokens]) |
| 223 | text = bytearray([self.byte_decoder[c] for c in text]).decode('utf-8', errors="replace").replace('</w>', ' ') |
| 224 | return text |
| 225 | |
| 226 | def __call__(self, texts: Union[str, List[str]], context_length: Optional[int] = None) -> torch.LongTensor: |
| 227 | """ Returns the tokenized representation of given input string(s) |
no outgoing calls