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 __init__(
      self,
      do_sample: List[bool],
      seeds: List[int],
      device: torch.device,
  ):
      self.seeds = seeds
  
      self.greedy_indices = []
      self.sampling_mapping = {}
      for i, (sample, seed) in enumerate(zip(do_sample, seeds)):
          if sample:
              self.sampling_mapping[i] = Sampling(seed, device)
          else:
              self.greedy_indices.append(i)
  
      self.greedy = Greedy()
  
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 1 to create a new HeterogeneousSampling object  with example: obj = HeterogeneousSampling(do_sample, seeds, device)