code: def build_vinvl_base(
      bert_model_name: str = "bert-base-uncased",
      img_feature_dim: int = 2054,
      use_img_layernorm: bool = True,
      img_layer_norm_eps: float = 1e-12,
      random_init: bool = True,
  ) -> VinVLBase:
      bert_config = retry_n(
          NUM_RETRIES,
          BertConfig.from_pretrained,
          bert_model_name,
      )
      # augment hf BertConfig for vinvl BertImgModel config
      bert_config.img_feature_dim = img_feature_dim
      bert_config.use_img_layernorm = use_img_layernorm
      bert_config.img_layer_norm_eps = img_layer_norm_eps
  
      if random_init:
          bert = VinVLBase(bert_config)
      else:
          bert = retry_n(
              NUM_RETRIES,
              VinVLBase.from_pretrained,
              bert_model_name,
              config=bert_config,
          )
      return bert
  
imports: import logging
  from collections import namedtuple
  from dataclasses import asdict, dataclass
  from typing import Any, Dict, Optional, Tuple
  import torch
  from mmf.common.registry import registry
  from mmf.common.sample import SampleList
  from mmf.models.base_model import BaseModel
  from mmf.models.transformers.heads.contrastive import ThreeWayContrastive
  from mmf.models.transformers.heads.mlm import MLM
  from mmf.models.transformers.heads.mlp import MLP
  from mmf.utils.general import retry_n
  from omegaconf import MISSING, OmegaConf
  from torch import nn, Tensor
label_desc: Use image node_id 1 for calling a global function with example usage: build_vinvl_base(bert_model_name, img_feature_dim, use_img_layernorm, img_layer_norm_eps, random_init) and returns: bert