code: def _get_decoded_targets_and_predictions(
      targets: Dict[str, torch.Tensor],
      predictions: Dict[str, Dict[str, torch.Tensor]],
      tokenizer: PreTrainedTokenizer,
      of_name: str,
  ):
      """Returns the decoded targets and predictions, accounting for IGNORE_INDEX_TOKEN_ID."""
      sanitized_targets = torch.where(
          targets[of_name] != IGNORE_INDEX_TOKEN_ID,
          targets[of_name],
          tokenizer.pad_token_id,
      )
      sanitized_predictions = torch.where(
          predictions[of_name][PREDICTIONS] != IGNORE_INDEX_TOKEN_ID,
          predictions[of_name][PREDICTIONS],
          tokenizer.pad_token_id,
      )
      decoded_targets = tokenizer.batch_decode(
          sanitized_targets, skip_special_tokens=True
      )
      decoded_predictions = tokenizer.batch_decode(
          sanitized_predictions, skip_special_tokens=True
      )
      return decoded_targets, decoded_predictions
  
imports: import copy
  import logging
  import tempfile
  from typing import Dict, Optional, Tuple, TYPE_CHECKING, Union
  import torch
  import torch.nn.functional
  import transformers
  from bitsandbytes.nn.modules import Embedding
  from packaging import version
  from transformers import AutoConfig, AutoModelForCausalLM, PreTrainedModel, PreTrainedTokenizer, TextStreamer
  from ludwig.constants import IGNORE_INDEX_TOKEN_ID, LOGITS, PREDICTIONS, PROBABILITIES
  from ludwig.schema.trainer import LLMTrainerConfig
  from ludwig.utils.error_handling_utils import default_retry
  from ludwig.utils.logging_utils import log_once
  from ludwig.utils.model_utils import find_embedding_layer_with_path
label_desc: Use image node_id 12 for calling a global function with example usage: _get_decoded_targets_and_predictions(targets, predictions, tokenizer, of_name) and returns: decoded_targets,  decoded_predictions