class_docstr: GPT2 with Retriever Model.
  
  A GPT2 model that receives documents from a retriever.
class_docstr_tok: ["GPT2","with","Retriever","Model",".","A","GPT2","model","that","receives","documents","from","a","retriever","."]
code: def build_retriever(
      cls,
      opt: Opt,
      dictionary: DictionaryAgent,
      retriever_shared: Optional[Dict[str, Any]],
  ) -> Optional[RagRetriever]:
      if opt.get("filter_docs_with_label"):
          assert (
              RetrieverType(opt["rag_retriever_type"])
              == RetrieverType.SEARCH_ENGINE
          )
          return FilterDocsForLabelSearchEngineRetrieverBase(
              opt, dictionary, shared=retriever_shared
          )  # type: ignore
      else:
          return retriever_factory(
              opt, dictionary, shared=retriever_shared
          )
  
imports: from typing import Optional, Type, Tuple, List, Dict, Any
  import torch
  import torch.nn
  from parlai.agents.fid.fid import FidModel, concat_enc_outs
  from parlai.agents.hugging_face.gpt2 import GPT2Decoder, Gpt2Agent
  from parlai.agents.rag.args import RetrieverType
  from parlai.agents.rag.modules import RagModel
  from parlai.agents.rag.retrievers import Document, BLANK_DOC, SearchQuerySearchEngineRetriever, retriever_factory, RagRetriever
  from parlai.core.dict import DictionaryAgent
  from parlai.core.opt import Opt
  import parlai.utils.logging
  from projects.seeker.agents.seeker_modules import ComboFidSearchQuerySearchEngineRetriever
  from projects.seeker.agents.seeker_modules import combo_fid_retriever_factory, interleave_fid_combo_outputs, ComboFidModel
label_desc: Use image node_id 2 for calling the GPT2WithRetrieverModel obj's underlying member method code with example usage: obj.build_retriever(cls, opt, dictionary, retriever_shared) and returns: FilterDocsForLabelSearchEngineRetrieverBase, retriever_factory