docstr: Override to save de-tokenized version of context.
docstr_tok: ["Override","to","save","de-tokenized","version","of","context","."]
code: def set_batch_context(
      self: TSType,
      batch_context_list: List[List[int]],
      batch_idx: int,
      gpu_beam_blocking: bool,
  ) -> TSType:
      """
      Override to save de-tokenized version of context.
      """
      # remove pad_idx from the batch vec
      self.context = batch_context_list[batch_idx]
      clean_context = clean_vec(
          batch_context_list[batch_idx],
          self.agent.END_IDX,
          [self.agent.NULL_IDX],
      )
      self.context_str = self.agent._v2t(clean_context)
      self.character = self.get_target_character()
      return self
  
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 3 for calling the PacerTreeSearchMixin obj's underlying member method code with example usage: obj.set_batch_context(batch_context_list, batch_idx, gpu_beam_blocking) and returns: self