docstr: Override select_paths to modify the logprobs according to classifier outputs.
  
  :param logprobs:
      a (beamsize x vocab) tensor of log probabilities. If this is the first
      turn in the dialogue, it will be a (1 x vocab) tensor.
  :param prior_scores:
      a (beamsize) tensor of weights with the cumulative running
      log-probability of each beam. If the first turn, it will be a (1) tensor.
  :param current_length:
      the current length in tokens
  :return:
      a (hypothesis_ids, token_id, scores) tuple, where:
  
      - hypothesis_ids is a LongTensor of hypotheses we're extending. May have
        repeats, but should always be (beamsize) long.
      - token_ids is a (beamsize) LongTensor of next-token choices for
        each of the hypotheses.
      - scores is a (beamsize) Tensor with the updated cumulative log-probs
        of each beam.
docstr_tok: ["Override","select_paths","to","modify","the","logprobs","according","to","classifier","outputs",".",":","param","logprobs",":","a","(","beamsize","x","vocab",")","tensor","of","log","probabilities",".","If","this","is","the","first","turn","in","the","dialogue",",","it","will","be","a","(","1","x","vocab",")","tensor",".",":","param","prior_scores",":","a","(","beamsize",")","tensor","of","weights","with","the","cumulative","running","log-probability","of","each","beam",".","If","the","first","turn",",","it","will","be","a","(","1",")","tensor",".",":","param","current_length",":","the","current","length","in","tokens",":","return",":","a","(","hypothesis_ids",",","token_id",",","scores",")","tuple",",","where",":","-","hypothesis_ids","is","a","LongTensor","of","hypotheses","we","'re","extending",".","May","have","repeats",",","but","should","always","be","(","beamsize",")","long",".","-","token_ids","is","a","(","beamsize",")","LongTensor","of","next-token","choices","for","each","of","the","hypotheses",".","-","scores","is","a","(","beamsize",")","Tensor","with","the","updated","cumulative","log-probs","of","each","beam","."]
code: def select_paths(
      self,
      logprobs: torch.Tensor,
      prior_scores: torch.Tensor,
      current_length: int,
  ):
      """
      Override select_paths to modify the logprobs according to classifier outputs.
  
      :param logprobs:
          a (beamsize x vocab) tensor of log probabilities. If this is the first
          turn in the dialogue, it will be a (1 x vocab) tensor.
      :param prior_scores:
          a (beamsize) tensor of weights with the cumulative running
          log-probability of each beam. If the first turn, it will be a (1) tensor.
      :param current_length:
          the current length in tokens
      :return:
          a (hypothesis_ids, token_id, scores) tuple, where:
  
          - hypothesis_ids is a LongTensor of hypotheses we're extending. May have
            repeats, but should always be (beamsize) long.
          - token_ids is a (beamsize) LongTensor of next-token choices for
            each of the hypotheses.
          - scores is a (beamsize) Tensor with the updated cumulative log-probs
            of each beam.
      """
      logprobs = self.modify_logprobs(logprobs)
      return super().select_paths(
          logprobs, prior_scores, current_length
      )
  
imports: import random
  import torch
  import torch.nn.functional
  from typing import Optional, Any, Dict, List
  from parlai.agents.rag.retrievers import clean_vec
  from parlai.agents.transformer.transformer import TransformerGeneratorAgent
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.torch_generator_agent import TreeSearch, GreedySearch, BeamSearch, DelayedBeamSearch, TopKSampling, NucleusSampling, TSType
  import parlai.utils.logging
  from parlai.utils.torch import neginf
  from projects.light_whoami.agents.rpa_rerank import RPAReranker, RPARerankAgent, LongRPARerankAgent
  from projects.light_whoami.task.utils import extract_characters
  from projects.msc.agents.long_tga import TransformerVariantAgent
  from parlai.agents.reranker.reranker import AbstractReranker
label_desc: Use image node_id 4 for calling the PacerTreeSearchMixin obj's underlying member method code with example usage: obj.select_paths(logprobs, prior_scores, current_length) and returns: super