class_docstr: Generator Rerank Agent.
  
  Utilize a classifier/predictor model as re-ranker with a generative agent.
class_docstr_tok: ["Generator","Rerank","Agent",".","Utilize","a","classifier\/predictor","model","as","re-ranker","with","a","generative","agent","."]
docstr: Setup reranker.
docstr_tok: ["Setup","reranker","."]
code: def __init__(self, opt: Opt, shared=None):
      """
      Setup reranker.
      """
      super().__init__(opt, shared)
      reranker_class = self.get_reranker_class()
      self.inference_opt_key = opt.get("inference_opt_key", "inference")
      self.inference_strategies = (
          opt["inference_strategies"] or opt[self.inference_opt_key]
      ).split(",")
      self.debug_mode = opt.get("debug_mode", False)
      if not shared:
          self.reranker = reranker_class(opt, shared=None)
      else:
          self.reranker = reranker_class(opt, shared=shared["reranker"])
  
imports: import logging
  import torch
  from abc import ABC, abstractmethod, abstractclassmethod
  from typing import List, Optional, Tuple
  from parlai.agents.transformer.transformer import TransformerGeneratorAgent
  from parlai.core.agents import create_agent_from_model_file, Agent
  from parlai.core.build_data import modelzoo_path
  from parlai.core.message import Message
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.torch_agent import TorchAgent
  from parlai.utils.strings import normalize_reply
  from parlai.utils.torch import argsort
  from parlai.agents.hugging_face.gpt2 import Gpt2Agent
  from projects.msc.agents.long_tga import TransformerVariantAgent
label_desc: Use image node_id 2 to create a new AbstractGeneratorRerankAgentMixin object  with example: obj = AbstractGeneratorRerankAgentMixin(opt, shared)