code: def _build_noganms(weights: Optional[str] = None):
      model = HiFiCAutoencoder()
      if weights is not None:
          if weights not in VALID_WEIGHTS:
              raise ValueError(
                  f"Unrecognized weights {weights}, must be one of {VALID_WEIGHTS}"
              )
  
          url = (
              "https://dl.fbaipublicfiles.com/NeuralCompression/2023-muckley-msillm/"
              + f"noganms_{weights}.ckpt"
          )
  
          LOGGER.info(
              f"Using {weights} NoGAN-MS weights. These weights are released under "
              f"the CC-BY-NC 4.0 license which can be found at "
              "https://github.com/facebookresearch/NeuralCompression/tree/main/WEIGHTS_LICENSE."
          )
  
          model.load_state_dict(
              torch.hub.load_state_dict_from_url(
                  url, map_location="cpu"
              )
          )
  
      return model
  
file_path: NeuralCompression/neuralcompression/zoo/_noganms.py
imports: import logging
  from typing import Optional
  import torch
  from neuralcompression.models import HiFiCAutoencoder
label_desc: Use image node_id 1 for calling a global function with example usage: _build_noganms(weights) and returns: model