code: def sparse_model_config(model_config):
      embedding_size = None
      if hasattr(model_config, "hidden_size"):
          embedding_size = model_config.hidden_size
      elif hasattr(model_config, "n_embed"):
          embedding_size = model_config.n_embed
      elif hasattr(model_config, "n_embd"):
          embedding_size = model_config.n_embd
  
      num_head = None
      if hasattr(model_config, "num_attention_heads"):
          num_head = model_config.num_attention_heads
      elif hasattr(model_config, "n_head"):
          num_head = model_config.n_head
  
      if embedding_size is None or num_head is None or num_head == 0:
          raise ValueError("Check the model config")
  
      num_embedding_size_per_head = int(embedding_size / num_head)
      if hasattr(model_config, "n_layer"):
          num_layer = model_config.n_layer
      elif hasattr(model_config, "num_hidden_layers"):
          num_layer = model_config.num_hidden_layers
      else:
          raise ValueError(
              "Number of hidden layers couldn't be determined from the model config"
          )
  
      return num_layer, num_head, num_embedding_size_per_head
  
imports: import argparse
  import inspect
  import logging
  from typing import Tuple
  import torch
  from accelerate import PartialState
  from accelerate.utils import set_seed
  from transformers import AutoTokenizer, BloomForCausalLM, BloomTokenizerFast, CTRLLMHeadModel, CTRLTokenizer, GenerationMixin, GPT2LMHeadModel, GPT2Tokenizer, GPTJForCausalLM, LlamaForCausalLM, LlamaTokenizer, OpenAIGPTLMHeadModel, OpenAIGPTTokenizer, OPTForCausalLM, TransfoXLLMHeadModel, TransfoXLTokenizer, XLMTokenizer, XLMWithLMHeadModel, XLNetLMHeadModel, XLNetTokenizer
  from transformers.modeling_outputs import CausalLMOutputWithPast
label_desc: Use image node_id 6 for calling a global function with example usage: sparse_model_config(model_config) and returns: num_layer,  num_head,  num_embedding_size_per_head