code: def get_local_pretrained_config_paths(
      config: DictConfig, path: str
  ) -> DictConfig:
      """
      Get the local config paths of hugginface pretrained models. With a local config,
      Hugginface can initialize a model without having to download its pretrained weights.
  
      Parameters
      ----------
      config
          A DictConfig object. The model config should be accessible by "config.model".
      path
          The saving path to the pretrained model configs.
      """
      for model_name in config.model.names:
          if model_name.lower().startswith(HF_MODELS):
              model_config = getattr(config.model, model_name)
              if model_config.checkpoint_name.startswith("local://"):
                  model_config.checkpoint_name = os.path.join(
                      path,
                      model_config.checkpoint_name[len("local://") :],
                  )
                  assert os.path.exists(
                      os.path.join(
                          model_config.checkpoint_name, "config.json"
                      )
                  )  # guarantee the existence of local configs
  
      return config
  
imports: import copy
  import logging
  import os
  import re
  import warnings
  from typing import Callable, Dict, List, Optional, Tuple, Union
  from omegaconf import DictConfig, OmegaConf
  from packaging import version
  from torch import nn
  from ..constants import AUTOMM, DATA, FT_TRANSFORMER, FUSION_TRANSFORMER, HF_MODELS, MODEL, REGRESSION, VALID_CONFIG_KEYS
  from ..presets import get_automm_presets, get_basic_automm_config
  from .data import get_detected_data_types
label_desc: Use image node_id 8 for calling a global function with example usage: get_local_pretrained_config_paths(config, path) and returns: config