class_docstr: Combo GPT2 Agent.
  
  This agent can handle retrieval for some contexts, and vanilla decoder-only
  computation for others.
class_docstr_tok: ["Combo","GPT2","Agent",".","This","agent","can","handle","retrieval","for","some","contexts",",","and","vanilla","decoder-only","computation","for","others","."]
docstr: Overrides batchify to add skip retrieval input vec.
code: def batchify(
      self, obs_batch: List[Message], sort: bool = False
  ) -> Batch:
      """
      Overrides batchify to add skip retrieval input vec.
      """
      batch = super().batchify(obs_batch, sort)
      valid_exs = [ex for ex in obs_batch if self.is_valid(ex)]
      if valid_exs:
          skip_retrieval = [
              ex.get(self.opt["skip_retrieval_key"], False)
              for ex in valid_exs
          ]
          batch.skip_retrieval_vec = torch.BoolTensor(skip_retrieval)
      return batch
  
imports: from typing import Optional, Tuple, List, Union
  import torch
  import torch.nn
  from parlai.agents.fid.fid import FidModel, FidAgent, SearchQuerySearchEngineFiDAgent, WizIntGoldDocRetrieverFiDAgent
  from parlai.agents.hugging_face.gpt2 import Gpt2Agent
  from parlai.agents.rag.rag import BaseGenerationAgentMixin
  from parlai.agents.rag.retrievers import Document
  from parlai.core.dict import DictionaryAgent
  from parlai.core.message import Message
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.torch_agent import Batch, Output
  from parlai.core.torch_generator_agent import TorchGeneratorAgent
  from parlai.utils.torch import padded_tensor
  from projects.seeker.agents.seeker import SeekerAgent
  from projects.seeker.agents.gpt2_seeker_modules import GPT2WithRetrieverModel, ComboGPT2Model
label_desc: Use image node_id 3 for calling the GPT2ComboAgent obj's underlying member method code with example usage: obj.batchify(obs_batch, sort) and returns: batch