def METHOD_NAME(self, text):
    tokens = self.tokenizer.encode(text)[:self.length - 2]
    tokens = [self.sos_token] + tokens + [self.eos_token]
    tokens = tokens + [0] * (self.length - len(tokens))
    return tokens