docstr: Build a new model instance.
docstr_tok: ["Build","a","new","model","instance","."]
code: def build_model(cls, args, task):
      """Build a new model instance."""
      # make sure that all args are properly defaulted
      # (in case there are any new ones)
      base_architecture(args)
  
      src_dict, tgt_dict = (
          task.source_dictionary,
          task.target_dictionary,
      )
  
      encoder_embed_tokens = (
          pytorch_translate_transformer.build_embedding(
              dictionary=src_dict,
              embed_dim=args.encoder_embed_dim,
              path=args.encoder_pretrained_embed,
              freeze=args.encoder_freeze_embed,
          )
      )
      decoder_embed_tokens = (
          pytorch_translate_transformer.build_embedding(
              dictionary=tgt_dict,
              embed_dim=args.decoder_embed_dim,
              path=args.decoder_pretrained_embed,
              freeze=args.decoder_freeze_embed,
          )
      )
  
      encoder = HybridTransformerRNNModel.build_encoder(
          args, src_dict, encoder_embed_tokens, proj_to_decoder=False
      )
      decoder = HybridTransformerRNNModel.build_decoder(
          args, src_dict, tgt_dict, decoder_embed_tokens
      )
      return HybridTransformerRNNModel(task, encoder, decoder)
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import utils
  from fairseq.models import FairseqEncoderDecoderModel, FairseqIncrementalDecoder, register_model, register_model_architecture, transformer
  from fairseq.modules import MultiheadAttention
  from pytorch_translate import multilingual_model, transformer, vocab_reduction
  from pytorch_translate.utils import torch_find
label_desc: Use image node_id 3 for calling the HybridTransformerRNNModel obj's underlying member method code with example usage: obj.build_model(cls, args, task) and returns: HybridTransformerRNNModel