simpletransformers/seq2seq/seq2seq_model.py
def load_and_cache_examples(self, data, evaluate=False, no_cache=False, verbose=True, silent=False):
        """
        Creates a T5Dataset from data.

        Utility function for train() and eval() methods. Not intended to be used directly.
        """

        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)
        else:
            if 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.
        
Creates a T5Dataset from data.
Utility function for train() and eval() methods. Not intended to be used directly.
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):
        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)
        else:
            if 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,)
def load_and_cache_examples ( self , data , evaluate = False , no_cache = False , verbose = True , silent = False ) : 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 ) else : if 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.
Creates a T5Dataset from data .
"""
        Creates a T5Dataset from data.

        Utility function for train() and eval() methods. Not intended to be used directly.
        """
self
data
evaluate
no_cache
verbose
silent