code: def _generative_step(self, batch: dict) -> dict:
      t0 = time.time()
  
      # parser.add_argument('--eval_max_gen_length', type=int, default=None, help='never generate more than n tokens')
      generated_ids = self.model.generate(
          batch["input_ids"],
          attention_mask=batch["attention_mask"],
          use_cache=True,
          decoder_start_token_id=self.decoder_start_token_id,
          num_beams=self.eval_beams,
          max_length=self.eval_max_length,
      )
      gen_time = (time.time() - t0) / batch["input_ids"].shape[0]
      preds: List[str] = self.ids_to_clean_text(generated_ids)
      target: List[str] = self.ids_to_clean_text(batch["labels"])
      loss_tensors = self._step(batch)
      base_metrics = dict(zip(self.loss_names, loss_tensors))
      rouge: Dict = self.calc_generative_metrics(preds, target)
      summ_len = np.mean(lmap(len, generated_ids))
      base_metrics.update(
          gen_time=gen_time,
          gen_len=summ_len,
          preds=preds,
          target=target,
          **rouge,
      )
      return base_metrics
  
imports: import argparse
  import glob
  import logging
  import os
  import sys
  import time
  from collections import defaultdict
  from pathlib import Path
  from typing import Dict, List, Tuple
  import numpy
  import pytorch_lightning
  import torch
  from callbacks import Seq2SeqLoggingCallback, get_checkpoint_callback, get_early_stopping_callback
  from torch import nn
  from torch.utils.data import DataLoader
  from transformers import MBartTokenizer, T5ForConditionalGeneration
  from transformers.models.bart.modeling_bart import shift_tokens_right
  from utils import ROUGE_KEYS, LegacySeq2SeqDataset, Seq2SeqDataset, assert_all_frozen, calculate_bleu, calculate_rouge, check_output_dir, flatten_list, freeze_embeds, freeze_params, get_git_info, label_smoothed_nll_loss, lmap, pickle_save, save_git_info, save_json, use_task_specific_params
  from lightning_base import BaseTransformer, add_generic_args, generic_train
label_desc: Use image node_id 11 for calling the SummarizationModule obj's underlying member method code with example usage: obj._generative_step(batch) and returns: base_metrics