code: def __init__(self, data, block_size):
      chars = list(set(data))
      data_size, vocab_size = len(data), len(chars)
      rank_zero_info(
          "data has %d characters, %d unique." % (data_size, vocab_size)
      )
  
      self.stoi = {ch: i for i, ch in enumerate(chars)}
      self.itos = {i: ch for i, ch in enumerate(chars)}
      self.block_size = block_size
      self.vocab_size = vocab_size
      self.data = data
  
imports: import math
  import os
  import pytorch_lightning
  import torch
  import torch.nn
  from pytorch_lightning import Trainer, seed_everything
  from pytorch_lightning.utilities import rank_zero_info
  from torch.nn import functional
  from torch.utils.data import DataLoader, Dataset, RandomSampler
  from xformers.factory.model_factory import xFormer, xFormerConfig
label_desc: Use image node_id 1 to create a new CharDataset object from inherited base classes: Dataset with example: obj = CharDataset(data, block_size)