code: def ds_transforms(example_batch):
      image_size = processor.image_processor.image_size
      image_mean = processor.image_processor.image_mean
      image_std = processor.image_processor.image_std
  
      image_transform = transforms.Compose(
          [
              convert_to_rgb,
              transforms.RandomResizedCrop(
                  (image_size, image_size),
                  scale=(0.9, 1.0),
                  interpolation=transforms.InterpolationMode.BICUBIC,
              ),
              transforms.ToTensor(),
              transforms.Normalize(mean=image_mean, std=image_std),
          ]
      )
  
      prompts = []
      for i in range(len(example_batch)):
          prompts.append(
              [
                  example_batch["image"][i],
                  f"Question: What's on the picture? Answer: {example_batch['text'][i]}\n",
              ],
          )
  
      inputs = processor(
          prompts, transform=image_transform, return_tensors="pt"
      ).to(device)
  
      inputs["labels"] = inputs["input_ids"]
  
      return inputs
  
imports: import torch
  import torchvision.transforms
  from datasets import load_dataset
  from PIL import Image
  from transformers import IdeficsForVisionText2Text, AutoProcessor, Trainer, TrainingArguments
label_desc: Use image node_id 3 for calling a global function with example usage: ds_transforms(example_batch) and returns: inputs