code: def build_decoder_with_embeddings(
      model_opt, vocabs, share_embeddings=False, src_emb=None
  ):
      # Build embeddings.
      tgt_emb = build_embeddings(model_opt, vocabs, for_encoder=False)
  
      if share_embeddings:
          tgt_emb.word_lut.weight = src_emb.word_lut.weight
  
      # Build decoder.
      decoder = build_decoder(model_opt, tgt_emb)
      return decoder, tgt_emb
  
imports: import torch
  import torch.nn
  from torch.nn.utils import skip_init
  from torch.nn.init import xavier_uniform_, zeros_, uniform_
  from onmt.models.model import NMTModel, LanguageModel
  from onmt.encoders import str2enc
  from onmt.decoders import str2dec
  from onmt.inputters.inputter import dict_to_vocabs
  from onmt.modules import Embeddings, CopyGenerator
  from onmt.utils.misc import use_gpu
  from onmt.utils.logging import logger
  from onmt.utils.parse import ArgumentParser
  from onmt.models.model_saver import load_checkpoint
  from onmt.constants import DefaultTokens, ModelTask
  from onmt.modules.lora import replace_lora_linear, replace_lora_embedding, mark_only_lora_as_trainable
label_desc: Use image node_id 7 for calling a global function with example usage: build_decoder_with_embeddings(model_opt, vocabs, share_embeddings, src_emb) and returns: decoder,  tgt_emb