code: def load_model_config(cfg):
      model_config_name = cfg.base_model_config or cfg.base_model
      if not model_config_name and cfg.tokenizer_config:
          model_config_name = cfg.tokenizer_config
      trust_remote_code = cfg.trust_remote_code is True
  
      try:
          model_config = AutoConfig.from_pretrained(
              model_config_name, trust_remote_code=trust_remote_code
          )
      except ValueError as err:
          if "mamba" in model_config_name:
              return addict.Dict(
                  {
                      "model_type": "mamba",
                  }
              )
          raise err
  
      if cfg.model_config:
          for key, val in cfg.model_config.items():
              setattr(model_config, key, val)
  
      check_model_config(cfg, model_config)
  
      return model_config
  
imports: import logging
  import math
  import os
  from typing import Any, Optional, Tuple, Union
  import addict
  import bitsandbytes
  import torch
  import transformers
  from optimum.bettertransformer import BetterTransformer
  from peft import PeftConfig, prepare_model_for_kbit_training
  from peft.tuners.lora import QuantLinear
  from transformers import AddedToken, AutoConfig, AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, GPTQConfig, PreTrainedModel, PreTrainedTokenizerBase
  from transformers.deepspeed import is_deepspeed_zero3_enabled
  from axolotl.models.mamba import fix_mamba_attn_for_loss
  from axolotl.prompt_tokenizers import LLAMA_DEFAULT_EOS_TOKEN
  from axolotl.utils.bench import log_gpu_memory_usage
  from axolotl.utils.chat_templates import chat_templates
  from axolotl.utils.dict import DictDefault
  from axolotl.utils.lora_embeddings import get_linear_embedding_layers
label_desc: Use image node_id 2 for calling a global function with example usage: load_model_config(cfg) and returns: model_config, addict