code: def _build_msillm_vqvae(
      vq_model: VqVaeXCiTAutoencoder, weights: Optional[str] = None
  ):
      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"{weights}.ckpt"
          )
  
          LOGGER.info(
              f"Using {weights} MS-ILLM VQ-VAE weights. These weights are "
              f"released under the CC-BY-NC 4.0 license which can be found at "
              "https://github.com/facebookresearch/NeuralCompression/tree/main/WEIGHTS_LICENSE."
          )
  
          vq_model.load_state_dict(
              torch.hub.load_state_dict_from_url(
                  url, map_location="cpu"
              )
          )
  
      return vq_model
  
imports: import logging
  from typing import Optional
  import torch
  from neuralcompression.layers import NormalizeLatent, ProjectLatent, VQBottleneck
  from neuralcompression.models import VqVaeXCiTAutoencoder
label_desc: Use image node_id 1 for calling a global function with example usage: _build_msillm_vqvae(vq_model, weights) and returns: vq_model