def METHOD_NAME(self, text_str):
    tokens = self.text_tokenizer.encode(text_str)
    max_tokens = 30
    text_ids_tensor = torch.zeros((1, max_tokens)).long()
    text_mask_tensor = torch.zeros((1, max_tokens))
    text_ids, text_mask = tokens.ids, tokens.attention_mask
    text_ids_tensor[0, 0:len(text_ids)] = torch.tensor(text_ids)
    text_mask_tensor[0, 0:len(text_mask)] = torch.tensor(text_mask)
    return text_ids_tensor, text_mask_tensor