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: Predict the class (or classes) of the received text using the
  serialized transformers checkpoint.
  Args:
      input_batch (list): List of Text Tensors from the pre-process function is passed here
  Returns:
      list : It returns a list of the predicted value for the input text
docstr_tok: ["Predict","the","class","(","or","classes",")","of","the","received","text","using","the","serialized","transformers","checkpoint",".","Args",":","input_batch","(","list",")",":","List","of","Text","Tensors","from","the","pre-process","function","is","passed","here","Returns",":","list",":","It","returns","a","list","of","the","predicted","value","for","the","input","text"]
code: def inference(self, input_batch):
      """Predict the class (or classes) of the received text using the
      serialized transformers checkpoint.
      Args:
          input_batch (list): List of Text Tensors from the pre-process function is passed here
      Returns:
          list : It returns a list of the predicted value for the input text
      """
      (input_ids_batch, _) = input_batch
      inferences = []
      input_ids_batch = input_ids_batch.to(self.device)
      outputs = self.model.generate(
          input_ids_batch,
          do_sample=True,
          max_new_tokens=int(self.setup_config["max_length"]),
          top_p=0.95,
          top_k=60,
      )
      for i, _ in enumerate(outputs):
          inferences.append(
              self.tokenizer.decode(
                  outputs[i], skip_special_tokens=True
              )
          )
  
      logger.info("Generated text: '%s'", inferences)
  
      print("Generated text", inferences)
      return inferences
  
file_path: serve/examples/large_models/Huggingface_accelerate/custom_handler.py
imports: import json
  import logging
  import os
  import zipfile
  from abc import ABC
  import torch
  import transformers
  from transformers import BloomForCausalLM, BloomTokenizerFast
  from ts.torch_handler.base_handler import BaseHandler
label_desc: Use image node_id 4 for calling the TransformersSeqClassifierHandler obj's underlying member method code with example usage: obj.inference(input_batch) and returns: inferences