code: def convert_config(fairseq_cfg, vocab_size, cfg):
      print("converting config")
      cfg.defrost()
      # Config for the bart base model
      cfg.MODEL.vocab_size = vocab_size
      cfg.MODEL.max_src_length = fairseq_cfg.max_source_positions
      cfg.MODEL.max_tgt_length = fairseq_cfg.max_target_positions
      cfg.MODEL.pos_embed_type = "learned"
      cfg.MODEL.shared_embed = fairseq_cfg.share_all_embeddings
      cfg.MODEL.scale_embed = not fairseq_cfg.no_scale_embedding
      cfg.MODEL.tie_weights = (
          fairseq_cfg.share_decoder_input_output_embed
      )
      cfg.MODEL.data_norm = fairseq_cfg.layernorm_embedding
      cfg.MODEL.pooler_activation = fairseq_cfg.pooler_activation_fn
      cfg.MODEL.layer_norm_eps = 1e-5
      cfg.MODEL.dropout = fairseq_cfg.dropout
      cfg.MODEL.activation_dropout = fairseq_cfg.activation_dropout
      cfg.MODEL.attention_dropout = fairseq_cfg.attention_dropout
      cfg.MODEL.dtype = "float32"
  
      # Parameters for the encoder
      cfg.MODEL.ENCODER.pre_norm = fairseq_cfg.encoder_normalize_before
      cfg.MODEL.ENCODER.num_layers = fairseq_cfg.encoder_layers
      cfg.MODEL.ENCODER.units = fairseq_cfg.encoder_embed_dim
      cfg.MODEL.ENCODER.num_heads = fairseq_cfg.encoder_attention_heads
      cfg.MODEL.ENCODER.hidden_size = fairseq_cfg.encoder_ffn_embed_dim
      cfg.MODEL.ENCODER.activation = fairseq_cfg.activation_fn
  
      # Parameters for the decoder
      cfg.MODEL.DECODER.pre_norm = fairseq_cfg.decoder_normalize_before
      cfg.MODEL.DECODER.num_layers = fairseq_cfg.decoder_layers
      cfg.MODEL.DECODER.units = fairseq_cfg.decoder_embed_dim
      cfg.MODEL.DECODER.num_heads = fairseq_cfg.decoder_attention_heads
      cfg.MODEL.DECODER.hidden_size = fairseq_cfg.decoder_ffn_embed_dim
      cfg.MODEL.DECODER.activation = fairseq_cfg.activation_fn
  
      cfg.INITIALIZER.embed = ["xavier", "gaussian", "in", 1.0]
      cfg.INITIALIZER.weight = ["xavier", "uniform", "avg", 1.0]
      cfg.INITIALIZER.bias = ["zeros"]
      cfg.VERSION = 1
      cfg.freeze()
      return cfg
  
file_path: gluon-nlp/docs/model_zoo/conversion_toolkits/convert_fairseq_bart.py
imports: import os
  import shutil
  import logging
  import argparse
  import mxnet
  import numpy
  from numpy.testing import assert_allclose
  import torch
  from fairseq.models.bart import BARTModel
  from gluonnlp.utils.misc import sha1sum, logging_config, naming_convention
  from gluonnlp.models.bart import BartModel
  from convert_fairseq_roberta import convert_vocab
label_desc: Use image node_id 2 for calling a global function with example usage: convert_config(fairseq_cfg, vocab_size, cfg) and returns: cfg