class_docstr: Override TransformerMemNetModel to build DPR Model Components.
class_docstr_tok: ["Override","TransformerMemNetModel","to","build","DPR","Model","Components","."]
docstr: Return build options for DprEncoders.
  
  :return (query_model, query_path, document_model, document_path):
      query_model: dpr query model type
      query_path: path to pre-trained DPR model
      document_model: dpr document model type
      document_path: path to pre-trained document model
docstr_tok: ["Return","build","options","for","DprEncoders",".",":","return","(","query_model",",","query_path",",","document_model",",","document_path",")",":","query_model",":","dpr","query","model","type","query_path",":","path","to","pre-trained","DPR","model","document_model",":","dpr","document","model","type","document_path",":","path","to","pre-trained","document","model"]
code: def _get_build_options(cls, opt: Opt):
      """
      Return build options for DprEncoders.
  
      :return (query_model, query_path, document_model, document_path):
          query_model: dpr query model type
          query_path: path to pre-trained DPR model
          document_model: dpr document model type
          document_path: path to pre-trained document model
      """
      query_model = "bert"
      document_model = "bert"
      query_path = opt["model_file"]
      document_path = opt["model_file"]
      try:
          # determine if loading a RAG model
          loaded_opt = Opt.load(f"{query_path}.opt")
          document_path = loaded_opt.get(
              "dpr_model_file", document_path
          )
          if loaded_opt["model"] in ["rag", "fid"] and loaded_opt[
              "query_model"
          ] in [
              "bert",
              "bert_from_parlai_rag",
          ]:
              query_model = "bert_from_parlai_rag"
              if loaded_opt["model"] == "fid":
                  # document model is always frozen
                  # but may be loading a FiD-RAG Model
                  doc_loaded_opt = Opt.load(
                      f"{modelzoo_path(opt['datapath'], document_path)}.opt"
                  )
                  document_path = doc_loaded_opt.get(
                      "dpr_model_file", document_path
                  )
  
      except FileNotFoundError:
          pass
  
      return query_model, query_path, document_model, document_path
  
imports: from parlai.agents.transformer.transformer import TransformerRankerAgent
  from parlai.agents.transformer.modules import TransformerMemNetModel, TransformerEncoder
  from parlai.agents.hugging_face.dict import HuggingFaceDictionaryAgent
  from parlai.agents.rag.args import DPR_ZOO_MODEL
  from parlai.agents.rag.conversion_utils import BertConversionUtils
  from parlai.core.build_data import modelzoo_path
  from parlai.core.dict import DictionaryAgent
  from parlai.core.loader import register_agent
  from parlai.core.opt import Opt
  from parlai.core.torch_ranker_agent import TorchRankerAgent
  from parlai.utils.io import PathManager
  import parlai.utils.logging
  import os
  import torch
  import torch.cuda
  import torch.nn
  from transformers import BertConfig
  from typing import Dict, Optional
label_desc: Use image node_id 1 for calling the DPRModel obj's underlying member method code with example usage: obj._get_build_options(cls, opt) and returns: query_model,  query_path,  document_model,  document_path