code: def test_tt_len_max_len_trun():
      train_data = "../data/tt/train-eval-grammar.csv"
      save_path = "data/tt/len-test/"
      max_input_length = 4
      max_output_length = 2
  
      args_max_len_truncation = TTTrainArgs(
          max_input_length=max_input_length,
          max_output_length=max_output_length,
          num_train_epochs=1,
          save_path=save_path,
      )
  
      happy_tt.train(train_data, args=args_max_len_truncation)
  
      tok_data = load_from_disk(save_path)
      print(tok_data)
  
      for case in tok_data["train"]["input_ids"]:
          print(case)
          assert len(case) == max_input_length
  
      for case in tok_data["eval"]["input_ids"]:
          print(case)
          assert len(case) == max_input_length
  
      for case in tok_data["train"]["labels"]:
          print(case)
          assert len(case) == max_output_length
  
      for case in tok_data["eval"]["labels"]:
          print(case)
          assert len(case) == max_output_length
  
file_path: happy-transformer/tests/test_tok_length.py
imports: import csv
  from happytransformer import HappyGeneration, HappyTextToText, HappyWordPrediction, GENTrainArgs, WPTrainArgs, TTTrainArgs
  from datasets import load_from_disk
  from tests import happy_gen, happy_wp, happy_tt
label_desc: Use image node_id 5 for calling a global function with example usage: test_tt_len_max_len_trun() without return types