code: def make_multi_folder_data(paths, caption_files=None, **kwargs):
      """Make a concat dataset from multiple folders
      Don't support captions yet
      If paths is a list, that's ok, if it's a Dict interpret it as:
      k=folder v=n_times to repeat that
      """
      list_of_paths = []
      if isinstance(paths, (Dict, DictConfig)):
          assert (
              caption_files is None
          ), "Caption files not yet supported for repeats"
          for folder_path, repeats in paths.items():
              list_of_paths.extend([folder_path] * repeats)
          paths = list_of_paths
  
      if caption_files is not None:
          datasets = [
              FolderData(p, caption_file=c, **kwargs)
              for (p, c) in zip(paths, caption_files)
          ]
      else:
          datasets = [FolderData(p, **kwargs) for p in paths]
      return torch.utils.data.ConcatDataset(datasets)
  
file_path: colossalai/examples/images/diffusion/ldm/data/teyvat.py
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 for calling a global function with example usage: make_multi_folder_data(paths, caption_files) and returns: torch