class_docstr: Generator for logging Audio Codec model outputs.
docstr: Args:
      model: model used to process input to generate artifacts
      batch_dict: dictionary obtained form the dataloader
      initial_log: save input audio for the initial log
docstr_tok: ["Args",":","model",":","model","used","to","process","input","to","generate","artifacts","batch_dict",":","dictionary","obtained","form","the","dataloader","initial_log",":","save","input","audio","for","the","initial","log"]
code: def generate_artifacts(
      self,
      model: LightningModule,
      batch_dict: Dict,
      initial_log: bool = False,
  ) -> Tuple[List[AudioArtifact], List[ImageArtifact]]:
      """
      Args:
          model: model used to process input to generate artifacts
          batch_dict: dictionary obtained form the dataloader
          initial_log: save input audio for the initial log
      """
  
      dataset_names = batch_dict.get("dataset_names")
      audio_filepaths = batch_dict.get("audio_filepaths")
      audio_ids = [create_id(p) for p in audio_filepaths]
  
      audio = batch_dict.get("audio")
      audio_len = batch_dict.get("audio_lens")
  
      audio_artifacts = self._generate_audio(
          model=model,
          dataset_names=dataset_names,
          audio_ids=audio_ids,
          audio=audio,
          audio_len=audio_len,
          save_input=initial_log,
      )
      image_artifacts = self._generate_images(
          model=model,
          dataset_names=dataset_names,
          audio_ids=audio_ids,
          audio=audio,
          audio_len=audio_len,
      )
  
      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 4 for calling the AudioCodecArtifactGenerator obj's underlying member method code with example usage: obj.generate_artifacts(model, batch_dict, initial_log) and returns: audio_artifacts,  image_artifacts