code: def _preprocess_data_train(
      self, input_filepath, eval_filepath, args: TrainArgs
  ):
      if not args.load_path:
          # We are loading raw data
          if eval_filepath == "":
              # eval_filepath was not provided so we use a portion of the training data for evaluating
              file_type = self._check_file_type(input_filepath)
              all_raw_data = load_dataset(
                  file_type,
                  data_files={"train": input_filepath},
                  split="train",
              )
              # Shuffle data
              all_raw_data = all_raw_data.shuffle(seed=42)
              # Split according to args.eval_ratio
              split_text_data = all_raw_data.train_test_split(
                  test_size=args.eval_ratio
              )
              self.logger.info("Tokenizing training data...")
  
              train_tok_data = self._tok_function(
                  split_text_data["train"], args, file_type
              )
              eval_tok_data = self._tok_function(
                  split_text_data["test"], args, file_type
              )
          else:
              # Eval path has been provided so we can load the evaluating data directly.
              train_file_type = self._check_file_type(input_filepath)
              eval_file_type = self._check_file_type(input_filepath)
  
              if train_file_type != eval_file_type:
                  raise ValueError(
                      "Train file-type must be the same as the eval file-type"
                  )
  
              raw_data = load_dataset(
                  train_file_type,
                  data_files={
                      "train": input_filepath,
                      "eval": eval_filepath,
                  },
              )
  
              # todo combine logic below with above tokenizing logic
              self.logger.info("Tokenizing training data...")
              train_tok_data = self._tok_function(
                  raw_data["train"], args, train_file_type
              )
              self.logger.info("Tokenizing eval data...")
              eval_tok_data = self._tok_function(
                  raw_data["eval"], args, train_file_type
              )
      else:
          if eval_filepath != "":
              self.logger.warning(
                  f"Eval data will be fetched from {args.load_path} and not {eval_filepath}"
              )
  
          tok_data = load_from_disk(args.load_path)
          train_tok_data = tok_data["train"]
          eval_tok_data = tok_data["eval"]
  
      if args.save_path:
          combined_tok = DatasetDict(
              {"train": train_tok_data, "eval": eval_tok_data}
          )
          combined_tok.save_to_disk(args.save_path)
  
      return train_tok_data, eval_tok_data
  
imports: import logging
  import os
  import tempfile
  from typing import Union
  from datasets import Dataset, DatasetDict, load_dataset, load_from_disk
  import torch
  from transformers import AutoConfig, AutoModel, AutoTokenizer, Seq2SeqTrainer, Seq2SeqTrainingArguments, Trainer, TrainingArguments
  from happytransformer.args import EvalArgs, TrainArgs
  from happytransformer.fine_tuning_util import EvalResult, FistStep, ZERO_2_SETTINGS, ZERO_3_SETTINGS
label_desc: Use image node_id 10 for calling the HappyTransformer obj's underlying member method code with example usage: obj._preprocess_data_train(input_filepath, eval_filepath, args) and returns: train_tok_data,  eval_tok_data