from datasets import load_dataset
from transformers import CLIPImageProcessor, CLIPTokenizer
from torch.utils.data import DataLoader
image_processor = CLIPImageProcessor.from_pretrained(clip_path)
tokenizer = CLIPTokenizer.from_pretrained(clip_path)
def tokenization(example):
text_inputs = tokenizer(example["text"], truncation=True, padding=True, return_tensors="pt")
image_inputs = image_processor(example["image"], return_tensors="pt")… See the full description on the dataset page:
https://huggingface.co/datasets/quaeast/multimodal_sarcasm_detection.