class_docstr: Callback which can log artifacts (eg. model predictions, graphs) to local disk, Tensorboard, and/or WandB.
  
  Args:
      generators: List of generators to create and log artifacts from.
      data_loader: Data to log artifacts for.
      log_epochs: Optional list of specific training epoch numbers to log artifacts for.
      epoch_frequency: Frequency with which to log
      output_dir: Optional local directory. If provided, artifacts will be saved in output_dir.
      loggers: Optional list of loggers to use if logging to tensorboard or wandb.
      log_tensorboard: Whether to log artifacts to tensorboard.
      log_wandb: Whether to log artifacts to WandB.
docstr: Log artifacts at the end of an epoch.
          
docstr_tok: ["Log","artifacts","at","the","end","of","an","epoch","."]
code: def on_train_epoch_end(
      self, trainer: Trainer, model: LightningModule
  ):
      """Log artifacts at the end of an epoch."""
      epoch = 1 + model.current_epoch
      if (epoch not in self.log_epochs) and (
          epoch % self.epoch_frequency != 0
      ):
          return
  
      audio_list = []
      image_list = []
      for batch_dict in self.data_loader:
          for key, value in batch_dict.items():
              if isinstance(value, torch.Tensor):
                  batch_dict[key] = value.to(model.device)
  
          for generator in self.generators:
              audio, images = generator.generate_artifacts(
                  model=model, batch_dict=batch_dict
              )
              audio_list += audio
              image_list += images
  
      if len(audio_list) == len(image_list) == 0:
          logging.debug(
              "List are empty, no artifacts to log at epoch %d.", epoch
          )
          return
  
      log_dir = (
          self.output_dir / f"epoch_{epoch}"
          if self.output_dir
          else None
      )
  
      self._log_artifacts(
          audio_list=audio_list, image_list=image_list, log_dir=log_dir
      )
  
imports: import os
  from abc import ABC, abstractmethod
  from dataclasses import dataclass
  from pathlib import Path
  from typing import Dict, List, Optional, Tuple, Type
  import librosa
  import numpy
  import soundfile
  import torch
  from einops import rearrange
  from pytorch_lightning import Callback, LightningModule, Trainer
  from pytorch_lightning.loggers import TensorBoardLogger
  from pytorch_lightning.loggers.logger import Logger
  from pytorch_lightning.loggers.wandb import WandbLogger
  from torch import Tensor
  from nemo.collections.tts.parts.utils.helpers import create_plot
  from nemo.utils import logging
  from nemo.utils.decorators import experimental
label_desc: Use image node_id 6 for calling the LoggingCallback obj's underlying member method code with example usage: obj.on_train_epoch_end(trainer, model) without return types