class_docstr: Model described in (https://arxiv.org/abs/1811.00945).
  
  A model for producing engaging captions about an image. Given an image and
  this model will attempt to predict an appropriate
  next utterance in the dialog, in the context of a given personality.
  
  See the paper linked above for more information.
class_docstr_tok: ["Model","described","in","(","https",":","\/\/arxiv.org\/abs\/1811.00945",")",".","A","model","for","producing","engaging","captions","about","an","image",".","Given","an","image","and","this","model","will","attempt","to","predict","an","appropriate","next","utterance","in","the","dialog",",","in","the","context","of","a","given","personality",".","See","the","paper","linked","above","for","more","information","."]
docstr: Set up the dictionary.
  
  The pretrained model used a separate dictionary from the standard ParlAI one.
docstr_tok: ["Set","up","the","dictionary",".","The","pretrained","model","used","a","separate","dictionary","from","the","standard","ParlAI","one","."]
code: def _setup_dict(self):
      """
      Set up the dictionary.
  
      The pretrained model used a separate dictionary from the standard ParlAI one.
      """
      self.dict = DictionaryAgent(self.opt)
      if self.opt.get("pretrained", False):
          new_tok2ind = {}
          new_ind2tok = {}
          for key in self.dict.tok2ind:
              val = self.dict.tok2ind[key]
              if val - 4 >= 0:
                  new_tok2ind[key] = val - 4
                  new_ind2tok[val - 4] = key
          self.dict.null_token = "<PAD>"
          self.dict.unk_token = "<UNK>"
          self.dict.tok2ind = new_tok2ind
          self.dict.ind2tok = new_ind2tok
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.core.agents import Agent
  from parlai.core.dict import DictionaryAgent
  from parlai.utils.misc import round_sigfigs
  from .modules import TransresnetModel
  from parlai.tasks.personality_captions.build import build
  from parlai.utils.io import PathManager
  import parlai.utils.torch
  import os
  import random
  import json
  import numpy
  import torch
  import tqdm
label_desc: Use image node_id 16 for calling the TransresnetAgent obj's underlying member method code with example usage: obj._setup_dict() without return types