class_docstr: Generator for logging FastPitch model outputs.
  
  Args:
      log_spectrogram: Whether to log predicted spectrograms.
      log_alignment: Whether to log alignment graphs.
      audio_params: Optional parameters for saving predicted audio.
          Requires a vocoder model checkpoint for generating audio from predicted spectrograms.
code: def generate_artifacts(
      self,
      model: LightningModule,
      batch_dict: Dict,
      initial_log: bool = False,
  ) -> Tuple[List[AudioArtifact], List[ImageArtifact]]:
      dataset_names = batch_dict.get("dataset_names")
      audio_filepaths = batch_dict.get("audio_filepaths")
      audio_ids = [create_id(p) for p in audio_filepaths]
  
      if initial_log:
          # Log ground truth audio and spectrograms
          audio_gt, spec_gt = self._create_ground_truth_artifacts(
              model=model,
              dataset_names=dataset_names,
              audio_ids=audio_ids,
              batch_dict=batch_dict,
          )
          return audio_gt, spec_gt
  
      audio_artifacts = []
      image_artifacts = []
  
      if self.log_audio or self.log_spectrogram:
          audio_pred, spec_pred = self._generate_predictions(
              model=model,
              dataset_names=dataset_names,
              audio_ids=audio_ids,
              batch_dict=batch_dict,
          )
          audio_artifacts += audio_pred
          image_artifacts += spec_pred
  
      if self.log_audio_gta or self.log_alignment:
          audio_gta_pred, alignments = self._generate_gta_predictions(
              model=model,
              dataset_names=dataset_names,
              audio_ids=audio_ids,
              batch_dict=batch_dict,
          )
          audio_artifacts += audio_gta_pred
          image_artifacts += alignments
  
      return audio_artifacts, image_artifacts
  
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 FastPitchArtifactGenerator obj's underlying member method code with example usage: obj.generate_artifacts(model, batch_dict, initial_log) and returns: audio_artifacts,  image_artifacts, audio_gt,  spec_gt