code: def load_falcon_config(args) -> FalconConfig:
      """Helper utility to load FalconConfig.
  
      Legacy Falcon-7B and Falcon-40B are not compatible with `transformers.FalconConfig` and
      `transformers.FalconModel`. need to manually set the config values
      and force to `falcon` model type.
      """
      config = FalconConfig.from_pretrained(args.input)
      if config.model_type == "RefinedWeb":
          mappings = {
              "num_hidden_layers": config.n_layer,
              "num_attention_heads": config.n_head,
              "num_kv_heads": config.n_head_kv,
              "new_decoder_architecture": True,
          }
      elif config.model_type == "RefinedWebModel":
          mappings = {
              "num_hidden_layers": config.n_layer,
              "num_attention_heads": config.n_head,
              "num_kv_heads": 1
              if config.multi_query
              else config.n_head,
              "new_decoder_architecture": False,
          }
      else:
          return config
  
      for key, value in mappings.items():
          setattr(config, key, value)
  
      config.model_type = "falcon"
      return config
  
file_path: NeMo/scripts/nlp_language_modeling/convert_hf_falcon_to_nemo.py
imports: import argparse
  import time
  from typing import Dict
  import pytorch_lightning
  import torch
  import yaml
  from omegaconf import OmegaConf
  from transformers import AutoModelForCausalLM, FalconConfig
  from nemo.collections.nlp.models.language_modeling.megatron_gpt_model import MegatronGPTModel
  from nemo.collections.nlp.parts.nlp_overrides import NLPDDPStrategy
  from nemo.utils import logging
label_desc: Use image node_id 2 for calling a global function with example usage: load_falcon_config(args) and returns: config, config