code: def test_max_new_tokens_encoder_decoder(self):
      model_cls = self.framework_dependent_parameters[
          "AutoModelForSeq2SeqLM"
      ]
      return_tensors = self.framework_dependent_parameters[
          "return_tensors"
      ]
      is_pt = not model_cls.__name__.startswith("TF")
  
      article = """Justin Timberlake and Jessica Biel, welcome to parenthood."""
      bart_tokenizer = AutoTokenizer.from_pretrained(
          "hf-internal-testing/tiny-random-bart"
      )
  
      bart_model = model_cls.from_pretrained(
          "hf-internal-testing/tiny-random-bart"
      )
      input_ids = bart_tokenizer(
          article, return_tensors=return_tensors
      ).input_ids
      if is_pt:
          bart_model = bart_model.to(torch_device)
          input_ids = input_ids.to(torch_device)
  
      self.assertEqual(list(input_ids.shape), [1, 29])
  
      max_new_tokens = 3
      bart_model.config.max_length = 20
      bart_model.config.eos_token_id = None
  
      # Encoder decoder call
      outputs = bart_model.generate(
          input_ids, max_new_tokens=max_new_tokens
      )
      # 1 BOS + 3 new tokens
      self.assertEqual(list(outputs.shape), [1, 4])
  
      # Decoder only call
      outputs = bart_model.generate(
          decoder_input_ids=input_ids, max_new_tokens=max_new_tokens
      )
      # 1 BOS + 29 (input length) + 3 new tokens
      self.assertEqual(list(outputs.shape), [1, 33])
  
      # Encoder decoder call > 20
      outputs = bart_model.generate(max_new_tokens=max_new_tokens + 20)
  
      # 1 BOS + 20 + 3 new tokens
      self.assertEqual(list(outputs.shape), [1, 24])
  
imports: import numpy
  from transformers import AutoTokenizer
  from transformers.testing_utils import slow, torch_device
label_desc: Use image node_id 3 for calling the GenerationIntegrationTestsMixin obj's underlying member method code with example usage: obj.test_max_new_tokens_encoder_decoder() without return types