MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / decode_batch

Method decode_batch

tensorrt_llm/runtime/generation.py:4277–4287  ·  view source on GitHub ↗
(self,
                     input_ids: Sequence[torch.Tensor],
                     sampling_config: SamplingConfig,
                     streaming: bool = False,
                     **kwargs)

Source from the content-addressed store, hash-verified

4275 yield None
4276
4277 def decode_batch(self,
4278 input_ids: Sequence[torch.Tensor],
4279 sampling_config: SamplingConfig,
4280 streaming: bool = False,
4281 **kwargs):
4282 input_ids, context_lengths = _prepare_input_ids(input_ids)
4283 return self.decode(input_ids,
4284 context_lengths,
4285 sampling_config,
4286 streaming=streaming,
4287 **kwargs)
4288
4289 # As dynamic_decoder uses torch's current stream, we must ensure it runs on the same stream that
4290 # dynamic_decoder was set up with

Callers 1

summarize_tensorrt_llmFunction · 0.80

Calls 2

decodeMethod · 0.95
_prepare_input_idsFunction · 0.85

Tested by

no test coverage detected