docstr: A debugging utility
docstr_tok: ["A","debugging","utility"]
code: def save_readable_batch(
      self, batch: Dict[str, torch.Tensor]
  ) -> Dict[str, List[str]]:
      """A debugging utility"""
      readable_batch = {
          k: self.tokenizer.batch_decode(v.tolist())
          if "mask" not in k
          else v.shape
          for k, v in batch.items()
      }
      save_json(
          readable_batch, Path(self.output_dir) / "text_batch.json"
      )
      save_json(
          {k: v.tolist() for k, v in batch.items()},
          Path(self.output_dir) / "tok_batch.json",
      )
  
      self.already_saved_batch = True
      return readable_batch
  
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 torch import nn
  from torch.utils.data import DataLoader
  from callbacks import Seq2SeqLoggingCallback, get_checkpoint_callback, get_early_stopping_callback
  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 2 for calling the SummarizationModule obj's underlying member method code with example usage: obj.save_readable_batch(batch) and returns: readable_batch