code: def load_model_config_from_hf(model_id: str):
      assert has_hf_hub(True)
      cached_file = download_from_hf(model_id, "config.json")
  
      hf_config = load_cfg_from_json(cached_file)
      if "pretrained_cfg" not in hf_config:
          # old form, pull pretrain_cfg out of the base dict
          pretrained_cfg = hf_config
          hf_config = {}
          hf_config["architecture"] = pretrained_cfg.pop("architecture")
          hf_config["num_features"] = pretrained_cfg.pop(
              "num_features", None
          )
          if (
              "labels" in pretrained_cfg
          ):  # deprecated name for 'label_names'
              pretrained_cfg["label_names"] = pretrained_cfg.pop(
                  "labels"
              )
          hf_config["pretrained_cfg"] = pretrained_cfg
  
      # NOTE currently discarding parent config as only arch name and pretrained_cfg used in timm right now
      pretrained_cfg = hf_config["pretrained_cfg"]
      pretrained_cfg[
          "hf_hub_id"
      ] = model_id  # insert hf_hub id for pretrained weight load during model creation
      pretrained_cfg["source"] = "hf-hub"
  
      # model should be created with base config num_classes if its exist
      if "num_classes" in hf_config:
          pretrained_cfg["num_classes"] = hf_config["num_classes"]
  
      # label meta-data in base config overrides saved pretrained_cfg on load
      if "label_names" in hf_config:
          pretrained_cfg["label_names"] = hf_config.pop("label_names")
      if "label_descriptions" in hf_config:
          pretrained_cfg["label_descriptions"] = hf_config.pop(
              "label_descriptions"
          )
  
      model_args = hf_config.get("model_args", {})
      model_name = hf_config["architecture"]
      return pretrained_cfg, model_name, model_args
  
imports: import hashlib
  import json
  import logging
  import os
  from functools import partial
  from pathlib import Path
  from tempfile import TemporaryDirectory
  from typing import Iterable, Optional, Union
  import torch
  from torch.hub import HASH_REGEX, download_url_to_file, urlparse
  from timm import __version__
  from timm.models._pretrained import filter_pretrained_cfg
label_desc: Use image node_id 8 for calling a global function with example usage: load_model_config_from_hf(model_id) and returns: pretrained_cfg,  model_name,  model_args