class_docstr: BART Agent.
  
  Relies on the BART model implemented in fairseq.
  
  If you have a fine-tuned BART model from fairseq, you can specify the
  `--init-fairseq-model` arg, which will convert your fine-tuned model
  to a ParlAI model.
class_docstr_tok: ["BART","Agent",".","Relies","on","the","BART","model","implemented","in","fairseq",".","If","you","have","a","fine-tuned","BART","model","from","fairseq",",","you","can","specify","the","`","--","init-fairseq-model","`","arg",",","which","will","convert","your","fine-tuned","model","to","a","ParlAI","model","."]
docstr: Convert fairseq init model to ParlAI Model.
  
  :param opt:
      options
  
  :return opt:
      return opt with new init_model path
docstr_tok: ["Convert","fairseq","init","model","to","ParlAI","Model",".",":","param","opt",":","options",":","return","opt",":","return","opt","with","new","init_model","path"]
code: def _convert_model(self, opt: Opt) -> Opt:
      """
      Convert fairseq init model to ParlAI Model.
  
      :param opt:
          options
  
      :return opt:
          return opt with new init_model path
      """
      args = self._get_conversion_args(opt)
      ConversionScript.main(**args)
      opt["init_model"] = args["output"]
      return opt
  
imports: import os
  import torch
  from typing import Optional, Dict, Any
  from parlai.agents.bart.convert_fairseq_to_parlai import ConversionScript
  from parlai.agents.bart.modules import BartModel
  from parlai.agents.transformer.transformer import TransformerGeneratorAgent
  from parlai.core.agents import compare_init_model_opts
  from parlai.core.message import Message
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.torch_agent import History
  from parlai.utils.typing import TShared
  from parlai.utils.io import PathManager
  from parlai.zoo.bart.build import download, CONVERSION_ARGS, BART_ARGS
label_desc: Use image node_id 5 for calling the BartAgent obj's underlying member method code with example usage: obj._convert_model(opt) and returns: opt