class_docstr: Transformers handler class for sequence, token classification and question answering.
class_docstr_tok: ["Transformers","handler","class","for","sequence",",","token","classification","and","question","answering","."]
docstr: Encodes a single input text using the tokenizer.
  Args:
      input_text (str): The input text to be encoded.
  Returns:
      tuple: A tuple with two tensors: the encoded input ids and the attention mask.
docstr_tok: ["Encodes","a","single","input","text","using","the","tokenizer",".","Args",":","input_text","(","str",")",":","The","input","text","to","be","encoded",".","Returns",":","tuple",":","A","tuple","with","two","tensors",":","the","encoded","input","ids","and","the","attention","mask","."]
code: def encode_input_text(self, input_text):
      """
      Encodes a single input text using the tokenizer.
      Args:
          input_text (str): The input text to be encoded.
      Returns:
          tuple: A tuple with two tensors: the encoded input ids and the attention mask.
      """
      if isinstance(input_text, (bytes, bytearray)):
          input_text = input_text.decode("utf-8")
      logger.info("Received text: '%s'", input_text)
      inputs = self.tokenizer.encode_plus(
          input_text,
          max_length=self.max_length,
          padding=True,
          add_special_tokens=True,
          return_tensors="pt",
          truncation=True,
      )
      input_ids = inputs["input_ids"]
      attention_mask = inputs["attention_mask"]
      return input_ids, attention_mask
  
file_path: serve/examples/large_models/deepspeed/custom_handler.py
imports: import logging
  from abc import ABC
  import torch
  import transformers
  from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
  from ts.context import Context
  from ts.handler_utils.distributed.deepspeed import get_ds_engine
  from ts.torch_handler.distributed.base_deepspeed_handler import BaseDeepSpeedHandler
label_desc: Use image node_id 4 for calling the TransformersSeqClassifierHandler obj's underlying member method code with example usage: obj.encode_input_text(input_text) and returns: input_ids,  attention_mask