class_docstr: Base class for all TTS models that turn text into a spectrogram 
class_docstr_tok: ["Base","class","for","all","TTS","models","that","turn","text","into","a","spectrogram"]
docstr: Accepts a batch of text or text_tokens and returns a batch of spectrograms
  
  Args:
      tokens: A torch tensor representing the text to be generated
  
  Returns:
      spectrograms
docstr_tok: ["Accepts","a","batch","of","text","or","text_tokens","and","returns","a","batch","of","spectrograms","Args",":","tokens",":","A","torch","tensor","representing","the","text","to","be","generated","Returns",":","spectrograms"]
code: def generate_spectrogram(
      self, tokens: "torch.tensor", **kwargs
  ) -> "torch.tensor":
      """
      Accepts a batch of text or text_tokens and returns a batch of spectrograms
  
      Args:
          tokens: A torch tensor representing the text to be generated
  
      Returns:
          spectrograms
      """
  
imports: import json
  from abc import ABC, abstractmethod
  from contextlib import ExitStack, contextmanager
  from typing import List, Optional
  import torch
  from omegaconf import DictConfig
  from tqdm import tqdm
  from nemo.collections.tts.parts.utils.helpers import OperationMode
  from nemo.core.classes import ModelPT
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.neural_types.elements import AudioSignal
  from nemo.core.neural_types.neural_type import NeuralType
  from nemo.utils import logging, model_utils
label_desc: Use image node_id 2 for calling the SpectrogramGenerator obj's underlying member method code with example usage: obj.generate_spectrogram(tokens) without return types