class_docstr: Classifier based on BERT implementation.
docstr: Upgrade opts from older model files.
docstr_tok: ["Upgrade","opts","from","older","model","files","."]
code: def upgrade_opt(cls, opt_on_disk):
      """
      Upgrade opts from older model files.
      """
      super(BertClassifierAgent, cls).upgrade_opt(opt_on_disk)
  
      # 2019-06-25: previous versions of the model did not add a CLS token
      # to the beginning of text_vec.
      if "add_cls_token" not in opt_on_disk:
          warn_once("Old model: overriding `add_cls_token` to False.")
          opt_on_disk["add_cls_token"] = False
  
      return opt_on_disk
  
imports: import os
  from collections import deque
  from typing import Optional
  import torch
  from parlai.agents.bert_ranker.bert_dictionary import BertDictionaryAgent
  from parlai.agents.bert_ranker.helpers import BertWrapper, MODEL_PATH
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.torch_agent import History
  from parlai.core.torch_classifier_agent import TorchClassifierAgent
  from parlai.utils.io import PathManager
  from parlai.utils.misc import warn_once
  from parlai.zoo.bert.build import download
label_desc: Use image node_id 5 for calling the BertClassifierAgent obj's underlying member method code with example usage: obj.upgrade_opt(cls, opt_on_disk) and returns: opt_on_disk