def METHOD_NAME(self, tokens: torch.LongTensor):
    assert tokens.dim() == 1
    tokens = tokens.cpu().numpy()
    if tokens[0] == self.task.source_dictionary.bos():
        tokens = tokens[1:]  # remove <s>
    eos_mask = tokens == self.task.source_dictionary.eos()
    doc_mask = eos_mask[1:] & eos_mask[:-1]
    sentences = np.split(tokens, doc_mask.nonzero()[0] + 1)
    sentences = [
        self.bpe.METHOD_NAME(self.task.source_dictionary.string(s)) for s in sentences
    ]
    if len(sentences) == 1:
        return sentences[0]
    return sentences