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 1
1
import itertools
2
2
from 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
5
7
6
8
from guidellm .backend .response import ResponseSummary
7
9
from guidellm .config import settings
@@ -69,12 +71,8 @@ def get_next_request(self) -> GenerationRequest:
69
71
return GenerationRequest (
70
72
request_type = settings .preferred_route ,
71
73
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 {}),
78
76
)
79
77
80
78
def get_next_delay (self ) -> float :
You can’t perform that action at this time.
0 commit comments