code: def _build(config, original):
      is_for_ctc = original.__class__.__name__ in [
          "Wav2Vec2ForCTC",
          "WavLMForCTC",
      ]
      if is_for_ctc:
          aux_num_out = original.config.vocab_size
          wav2vec2 = original.wav2vec2
      else:
          _LG.warning(
              "The model is not an instance of Wav2Vec2ForCTC or WavLMForCTC. "
              '"lm_head" module is not imported.'
          )
          aux_num_out = None
          wav2vec2 = original
      is_wavlm = original.__class__.__name__ in [
          "WavLMModel",
          "WavLMForCTC",
      ]
      if is_wavlm:
          imported = wavlm_model(**config, aux_num_out=aux_num_out)
      else:
          imported = wav2vec2_model(**config, aux_num_out=aux_num_out)
      imported.feature_extractor.load_state_dict(
          wav2vec2.feature_extractor.state_dict()
      )
      imported.encoder.feature_projection.load_state_dict(
          wav2vec2.feature_projection.state_dict()
      )
      encoder_state_dict = wav2vec2.encoder.state_dict()
      if (
          is_wavlm
      ):  # Rename paramaters of linear transformations for compatibility with the HF model
          transform_wavlm_encoder_state(
              encoder_state_dict, config["encoder_num_layers"]
          )
      imported.encoder.transformer.load_state_dict(encoder_state_dict)
      if is_for_ctc:
          imported.aux.load_state_dict(original.lm_head.state_dict())
      return imported
  
file_path: audio/src/torchaudio/models/wav2vec2/utils/import_huggingface.py
imports: import logging
  from typing import Any, Dict
  import torch
  from torch.nn import Module
  from ..model import wav2vec2_model, Wav2Vec2Model, wavlm_model
label_desc: Use image node_id 3 for calling a global function with example usage: _build(config, original) and returns: imported