code: def forward(
      self,
      input_ids,
      attention_mask,
      position_ids,
      pixel_values,
      image_hidden_states,
      image_attention_mask,
      past_key_values: Optional = None,
  ) -> Tuple[torch.Tensor, List[Tuple[torch.Tensor, torch.Tensor]]]:
      # Model Forward
      kwargs = {
          "input_ids": input_ids,
          "attention_mask": attention_mask,
          "pixel_values": pixel_values,
          "image_hidden_states": image_hidden_states,
          "image_attention_mask": image_attention_mask,
          "past_key_values": past_key_values,
          "use_cache": True,
          "return_dict": True,
      }
      if self.has_position_ids:
          kwargs["position_ids"] = position_ids
  
      outputs = self.model.forward(**kwargs)
      return (
          outputs.logits,
          outputs.past_key_values,
          outputs.image_hidden_states,
      )
  
imports: import torch
  import time
  from dataclasses import dataclass
  from opentelemetry import trace
  from transformers import AutoProcessor, AutoTokenizer, PreTrainedTokenizerBase, ProcessorMixin
  from typing import Optional, Tuple, List, Type, Dict
  from text_generation_server.models import Model
  from text_generation_server.models.types import Batch, Tokens, Generation, GeneratedText
  from text_generation_server.pb import generate_pb2
  from text_generation_server.utils import NextTokenChooser, StoppingCriteria, Sampling
  import re
label_desc: Use image node_id 3 for calling the IdeficsCausalLM obj's underlying member method code with example usage: obj.forward(input_ids, attention_mask, position_ids, pixel_values, image_hidden_states, image_attention_mask, past_key_values) and returns: outputs,  outputs,  outputs