code: def get_hugging_face_model_lm_head(model):
      if hasattr(model, "lm_head"):
          lm_head = model.lm_head
      elif hasattr(model, "embed_out"):
          lm_head = model.embed_out
      else:
          raise Exception("Can not find the LM head attribute")
  
      return lm_head
  
file_path: espnet/espnet2/asr/decoder/hugging_face_transformers_decoder.py
imports: import copy
  import logging
  from typing import Any, List, Tuple
  import torch
  import torch.nn.functional
  from typeguard import check_argument_types
  from espnet2.asr.decoder.abs_decoder import AbsDecoder
  from espnet.nets.pytorch_backend.nets_utils import make_pad_mask
  from espnet.nets.scorer_interface import BatchScorerInterface
label_desc: Use image node_id 2 for calling a global function with example usage: get_hugging_face_model_lm_head(model) and returns: lm_head