code: def model_provider(pre_process=True, post_process=True):
      """Build the model."""
  
      print_rank_0(" > build Bert model.")
  
      args = get_args()
      config = core_transformer_config_from_args(args)
      num_tokentypes = 2 if args.bert_binary_head else 0
      model = BertModel(
          config=config,
          num_tokentypes=num_tokentypes,
          add_binary_head=args.bert_binary_head,
          parallel_output=True,
          pre_process=pre_process,
          post_process=post_process,
      )
  
      return model
  
imports: from functools import partial
  import numpy
  import os
  import time
  import torch
  from torch.utils.data import BatchSampler, DataLoader, SequentialSampler, Subset
  from torch.utils.data._utils.collate import default_collate
  from tqdm import tqdm
  from megatron import get_args, get_tokenizer, print_rank_0
  from megatron import core
  from megatron.arguments import core_transformer_config_from_args
  from megatron.core.enums import ModelType
  from megatron.core.pipeline_parallel import get_forward_backward_func
  from megatron.model import BertModel
  from megatron.training import setup_model_and_optimizer
  from .dataset import BertEmbeddingDataset
  from .external_libs import h5py
  from .huggingface import HuggingfaceEmbedder
  from .utils import get_missing_blocks_by_rank
label_desc: Use image node_id 1 for calling a global function with example usage: model_provider(pre_process, post_process) and returns: model