code: def __init__(
      self,
      tokenizer,
      max_length,
      path,
      max_output_length=None,
      unseen_types=[],
      no_bos=False,
  ):
      self.tokenizer = tokenizer
      self.max_length = self.max_output_length = max_length
      if max_output_length is not None:
          self.max_output_length = max_output_length
      self.path = path
      self.no_bos = no_bos  # if you use bart, then this should be False; if you use t5, then this should be True
      self.data = []
      self.load_data(unseen_types)
  
imports: import json, logging, pickle
  from mimetypes import knownfiles
  from unittest.mock import NonCallableMagicMock
  import torch
  from torch.utils.data import Dataset
  from collections import namedtuple
label_desc: Use image node_id 1 to create a new GenDataset object from inherited base classes: Dataset with example: obj = GenDataset(tokenizer, max_length, path, max_output_length, unseen_types, no_bos)