MCPcopy
hub / github.com/NVIDIA/TensorRT-LLM / throttle_generator

Function throttle_generator

examples/utils.py:121–127  ·  view source on GitHub ↗
(generator, stream_interval)

Source from the content-addressed store, hash-verified

119
120
121def throttle_generator(generator, stream_interval):
122 for i, out in enumerate(generator):
123 if not i % stream_interval:
124 yield out
125
126 if i % stream_interval:
127 yield out
128
129
130# Load tokenizer impl, it will be called in external wrapper to avoid loading tokenizer bug under MPI env.

Callers 1

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected