docstr: Returns only captions with dummy images
docstr_tok: ["Returns","only","captions","with","dummy","images"]
code: def __init__(
      self,
      captions,
      output_size,
      image_key="image",
      caption_key="txt",
      n_gpus=1,
  ):
      """Returns only captions with dummy images"""
      self.output_size = output_size
      self.image_key = image_key
      self.caption_key = caption_key
      if isinstance(captions, Path):
          self.captions = self._load_caption_file(captions)
      else:
          self.captions = captions
  
      if n_gpus > 1:
          # hack to make sure that all the captions appear on each gpu
          repeated = [n_gpus * [x] for x in self.captions]
          self.captions = []
          [self.captions.extend(x) for x in repeated]
  
imports: import json
  from pathlib import Path
  from typing import Dict
  import torch
  from datasets import load_dataset
  from einops import rearrange
  from ldm.util import instantiate_from_config
  from omegaconf import DictConfig, ListConfig
  from PIL import Image
  from torch.utils.data import Dataset
  from torchvision import transforms
label_desc: Use image node_id 1 to create a new TextOnly object from inherited base classes: Dataset with example: obj = TextOnly(captions, output_size, image_key, caption_key, n_gpus)