File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 11import itertools
22from abc import ABC , abstractmethod
3- from collections .abc import Sequence
4- from typing import Generic
3+ from typing import TYPE_CHECKING , Generic
4+
5+ if TYPE_CHECKING :
6+ from collections .abc import Sequence
57
68from guidellm .backend .response import ResponseSummary
79from guidellm .config import settings
@@ -69,12 +71,8 @@ def get_next_request(self) -> GenerationRequest:
6971 return GenerationRequest (
7072 request_type = settings .preferred_route ,
7173 content = content ,
72- stats = (
73- {"prompt_tokens" : prompt_tokens } if prompt_tokens is not None else {}
74- ),
75- constraints = (
76- {"output_tokens" : output_tokens } if output_tokens is not None else {}
77- ),
74+ stats = ({"prompt_tokens" : prompt_tokens } if prompt_tokens else {}),
75+ constraints = ({"output_tokens" : output_tokens } if output_tokens else {}),
7876 )
7977
8078 def get_next_delay (self ) -> float :
You can’t perform that action at this time.
0 commit comments