def load_and_cache_examples(self, data, evaluate=False, no_cache=False, verbose=True, silent=False):
    '\n        Creates a T5Dataset from data.\n\n        Utility function for train() and eval() methods. Not intended to be used directly.\n        '
    encoder_tokenizer = self.encoder_tokenizer
    decoder_tokenizer = self.decoder_tokenizer
    args = self.args
    if (not no_cache):
        no_cache = args.no_cache
    if (not no_cache):
        os.makedirs(self.args.cache_dir, exist_ok=True)
    mode = ('dev' if evaluate else 'train')
    if args.dataset_class:
        CustomDataset = args.dataset_class
        return CustomDataset(encoder_tokenizer, decoder_tokenizer, args, data, mode)
    elif (args.model_type in ['bart', 'marian']):
        return SimpleSummarizationDataset(encoder_tokenizer, self.args, data, mode)
    else:
        return Seq2SeqDataset(encoder_tokenizer, decoder_tokenizer, self.args, data, mode)
Creates a T5Dataset from data.

Utility function for train() and eval() methods. Not intended to be used directly.
def load_and_cache_examples(self, data, evaluate=False, no_cache=False, verbose=True, silent=False):
    '\n        Creates a T5Dataset from data.\n\n        Utility function for train() and eval() methods. Not intended to be used directly.\n        '
    encoder_tokenizer = self.encoder_tokenizer
    decoder_tokenizer = self.decoder_tokenizer
    args = self.args
    if (not no_cache):
        no_cache = args.no_cache
    if (not no_cache):
        os.makedirs(self.args.cache_dir, exist_ok=True)
    mode = ('dev' if evaluate else 'train')
    if args.dataset_class:
        CustomDataset = args.dataset_class
        return CustomDataset(encoder_tokenizer, decoder_tokenizer, args, data, mode)
    elif (args.model_type in ['bart', 'marian']):
        return SimpleSummarizationDataset(encoder_tokenizer, self.args, data, mode)
    else:
        return Seq2SeqDataset(encoder_tokenizer, decoder_tokenizer, self.args, data, mode)