class_docstr: Model from "Engaging Image Chat: Modeling Personality in Grounded Dialogue".
  
  See paper for more details: (https://arxiv.org/abs/1811.00945)
  
  An extension of the model from https://arxiv.org/abs/1810.10665; given
  an image, personality, and dialogue history, predicts the next utterance
  in a dialogue.
class_docstr_tok: ["Model","from","``","Engaging","Image","Chat",":","Modeling","Personality","in","Grounded","Dialogue","''",".","See","paper","for","more","details",":","(","https",":","\/\/arxiv.org\/abs\/1811.00945",")","An","extension","of","the","model","from","https",":","\/\/arxiv.org\/abs\/1810.10665",";","given","an","image",",","personality",",","and","dialogue","history",",","predicts","the","next","utterance","in","a","dialogue","."]
code: def _build_model(self, path=None):
      init_model_path = None
      if self.opt.get("init_model") and PathManager.exists(
          self.opt["init_model"]
      ):
          init_model_path = self.opt["init_model"]
      elif self.opt.get("model_file") and PathManager.exists(
          self.opt["model_file"]
      ):
          init_model_path = self.opt["model_file"]
      elif path is not None:
          init_model_path = path
      print("Creating or loading model")
      self.model = TransresnetMultimodalModel(
          self.opt, self.personalities_list, self.dict
      )
      if init_model_path is not None:
          self.load(init_model_path)
      if self.use_cuda:
          self.model.cuda()
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.utils.misc import round_sigfigs
  from parlai.core.message import Message
  from .modules import TransresnetMultimodalModel
  from projects.personality_captions.transresnet.transresnet import TransresnetAgent
  from parlai.utils.io import PathManager
  import parlai.utils.torch
  import torch
  from torch import optim
  import random
  import numpy
  import tqdm
  from collections import deque
label_desc: Use image node_id 3 for calling the TransresnetMultimodalAgent obj's underlying member method code with example usage: obj._build_model(path) without return types