class_docstr: Mixed greedy and probabilistic sampling. Compute both and pick the right one for each sample.
class_docstr_tok: ["Mixed","greedy","and","probabilistic","sampling",".","Compute","both","and","pick","the","right","one","for","each","sample","."]
code: def filter(self, indices):
      new_greedy_indices = []
      new_sampling_mapping = {}
      for i, idx in enumerate(indices):
          if idx in self.sampling_mapping:
              new_sampling_mapping[i] = self.sampling_mapping[idx]
          else:
              new_greedy_indices.append(i)
  
      self.greedy_indices = new_greedy_indices
      self.sampling_mapping = new_sampling_mapping
      return self
  
imports: import re
  from typing import Callable, List, Optional, Tuple
  import torch
  from text_generation_server.pb import generate_pb2
  from text_generation_server.pb.generate_pb2 import FinishReason
  from text_generation_server.utils.logits_process import HeterogeneousProcessorWrapper, HeterogeneousRepetitionPenaltyLogitsProcessor, HeterogeneousTemperatureLogitsWarper, HeterogeneousTopKLogitsWarper, HeterogeneousTopPLogitsWarper, HeterogeneousTypicalLogitsWarper, static_warper
  from text_generation_server.utils.watermark import WatermarkLogitsProcessor
  from transformers import PreTrainedTokenizerBase, RepetitionPenaltyLogitsProcessor
label_desc: Use image node_id 3 for calling the HeterogeneousSampling obj's underlying member method code with example usage: obj.filter(indices) and returns: self