code: def __init__(
      self,
      checkpoint_path: str,
      model_cfg: Dict[str, str],
      fp16: bool = False,
  ) -> None:
      super().__init__()
      self.model = HiFiGANModel(model_cfg)
      state_dict = torch.load(checkpoint_path)
      self.model.load_state_dict(state_dict["generator"])
      if fp16:
          self.model.half()
      logger.info(f"loaded HiFiGAN checkpoint from {checkpoint_path}")
  
imports: import json
  import logging
  from typing import Dict
  import numpy
  import torch
  import torch.nn.functional
  from torch import nn
  from fairseq.data.audio.audio_utils import TTSSpectrogram, get_fourier_basis, get_mel_filters, get_window
  from fairseq.data.audio.speech_to_text_dataset import S2TDataConfig
  from fairseq.models import BaseFairseqModel, register_model
  from fairseq.models.text_to_speech.codehifigan import CodeGenerator
  from fairseq.models.text_to_speech.hifigan import Generator
  from fairseq.models.text_to_speech.hub_interface import VocoderHubInterface
label_desc: Use image node_id 1 to create a new HiFiGANVocoder object from inherited base classes: nn with example: obj = HiFiGANVocoder(checkpoint_path, model_cfg, fp16)