code: def recursively_load_weights(fairseq_model, hf_model, is_finetuned):
      unused_weights = []
      fairseq_dict = fairseq_model.state_dict()
  
      feature_extractor = hf_model.unispeech.feature_extractor
  
      for name, value in fairseq_dict.items():
          is_used = False
          if "conv_layers" in name:
              load_conv_layer(
                  name,
                  value,
                  feature_extractor,
                  unused_weights,
                  hf_model.config.feat_extract_norm == "group",
              )
              is_used = True
          else:
              for key, mapped_key in MAPPING.items():
                  mapped_key = (
                      "unispeech." + mapped_key
                      if mapped_key not in TOP_LEVEL_KEYS
                      else mapped_key
                  )
                  if (
                      key in name
                      or key.split("w2v_model.")[-1]
                      == name.split(".")[0]
                  ):
                      is_used = True
                      if "*" in mapped_key:
                          layer_index = name.split(key)[0].split(".")[
                              -2
                          ]
                          mapped_key = mapped_key.replace(
                              "*", layer_index
                          )
                      if "weight_g" in name:
                          weight_type = "weight_g"
                      elif "weight_v" in name:
                          weight_type = "weight_v"
                      elif "bias" in name:
                          weight_type = "bias"
                      elif "weight" in name:
                          # TODO: don't match quantizer.weight_proj
                          weight_type = "weight"
                      else:
                          weight_type = None
                      set_recursively(
                          hf_model,
                          mapped_key,
                          value,
                          name,
                          weight_type,
                          is_finetuned,
                      )
                  continue
          if not is_used:
              unused_weights.append(name)
  
      logger.warning(f"Unused weights: {unused_weights}")
  
file_path: transformers/src/transformers/models/unispeech/convert_unispeech_original_pytorch_checkpoint_to_pytorch.py
imports: import argparse
  import json
  import os
  import fairseq
  import torch
  from fairseq.data import Dictionary
  from transformers import UniSpeechConfig, UniSpeechForCTC, UniSpeechForPreTraining, Wav2Vec2FeatureExtractor, Wav2Vec2PhonemeCTCTokenizer, Wav2Vec2Processor, logging
label_desc: Use image node_id 2 for calling a global function with example usage: recursively_load_weights(fairseq_model, hf_model, is_finetuned) without return types