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

Function test_GenerationResultBase

tests/unittest/llmapi/test_executor.py:294–305  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

292
293
294def test_GenerationResultBase():
295 sampling_params = SamplingParams(max_tokens=4)
296 result = GenerationResultBase(
297 id=2,
298 sampling_params=sampling_params,
299 )
300 result._handle_response(create_rsp(2, finished=False))
301 result._handle_response(create_rsp(3, finished=False))
302 result._handle_response(create_rsp(4, finished=True))
303 print(result.outputs[0])
304 assert len(result.outputs[0].token_ids) == 3
305 assert result._done
306
307
308def test_GenerationResult():

Callers

nothing calls this directly

Calls 4

_handle_responseMethod · 0.95
SamplingParamsClass · 0.90
create_rspFunction · 0.85

Tested by

no test coverage detected