code: def captum_sequence_forward(
      inputs, attention_mask=None, position=0, model=None
  ):
      """This function is used to get the predictions from the model and this function
      can be used independent of the type of the BERT Task.
      Args:
          inputs (list): Input for Predictions
          attention_mask (list, optional): The attention mask is a binary tensor indicating the position
           of the padded indices so that the model does not attend to them, it defaults to None.
          position (int, optional): Position depends on the BERT Task.
          model ([type], optional): Name of the model, it defaults to None.
      Returns:
          list: Prediction Outcome
      """
      model.eval()
      model.zero_grad()
      pred = model(inputs, attention_mask=attention_mask)
      pred = pred[position]
      return pred
  
imports: import ast
  import json
  import logging
  import os
  from abc import ABC
  import torch
  import transformers
  from captum.attr import LayerIntegratedGradients
  from transformers import AutoModelForCausalLM, AutoModelForQuestionAnswering, AutoModelForSequenceClassification, AutoModelForTokenClassification, AutoTokenizer, GPT2TokenizerFast
  from ts.torch_handler.base_handler import BaseHandler
label_desc: Use image node_id 2 for calling a global function with example usage: captum_sequence_forward(inputs, attention_mask, position, model) and returns: pred