class_docstr: Loads a HuggingFace ``transformers`` model and tokenizer.
docstr: Passes inputs to HuggingFace models as keyword arguments.
  
  (Regular PyTorch ``nn.Module`` models typically take inputs as
  positional arguments.)
code: def __call__(self, text_input_list):
      """Passes inputs to HuggingFace models as keyword arguments.
  
      (Regular PyTorch ``nn.Module`` models typically take inputs as
      positional arguments.)
      """
      # Default max length is set to be int(1e30), so we force 512 to enable batching.
      max_length = (
          512
          if self.tokenizer.model_max_length == int(1e30)
          else self.tokenizer.model_max_length
      )
      inputs_dict = self.tokenizer(
          text_input_list,
          add_special_tokens=True,
          padding="max_length",
          max_length=max_length,
          truncation=True,
          return_tensors="pt",
      )
      model_device = next(self.model.parameters()).device
      inputs_dict.to(model_device)
  
      with torch.no_grad():
          outputs = self.model(**inputs_dict)
  
      if isinstance(outputs[0], str):
          # HuggingFace sequence-to-sequence models return a list of
          # string predictions as output. In this case, return the full
          # list of outputs.
          return outputs
      else:
          # HuggingFace classification models return a tuple as output
          # where the first item in the tuple corresponds to the list of
          # scores for each input.
          return outputs.logits
  
file_path: TextAttack/textattack/models/wrappers/huggingface_model_wrapper.py
imports: import torch
  import transformers
  import textattack
  from textattack.models.helpers import T5ForTextToText
  from textattack.models.tokenizers import T5Tokenizer
  from .pytorch_model_wrapper import PyTorchModelWrapper
label_desc: Use image node_id 2 for calling the HuggingFaceModelWrapper obj's underlying member method code with example usage: obj.__call__(text_input_list) and returns: outputs, outputs