()
| 306 | |
| 307 | |
| 308 | def 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 | |
| 320 | def test_DetokenizedGenerationResultBase(): |
nothing calls this directly
no test coverage detected