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

Function test_GenerationResult

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

Source from the content-addressed store, hash-verified

306
307
308def test_GenerationResult():
309 request = GenerationRequest(prompt_token_ids=[12, 23, 34],
310 sampling_params=SamplingParams(max_tokens=4))
311 result = GenerationResult(request)
312
313 for i in range(11):
314 result._handle_response(create_rsp(i + 33, finished=False))
315 result._handle_response(create_rsp(44, finished=True))
316 assert len(result.outputs[0].token_ids) == 12
317 assert result._done
318
319
320def test_DetokenizedGenerationResultBase():

Callers

nothing calls this directly

Calls 5

GenerationRequestClass · 0.90
SamplingParamsClass · 0.90
GenerationResultClass · 0.90
create_rspFunction · 0.85
_handle_responseMethod · 0.45

Tested by

no test coverage detected