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
@@ -64,12 +66,8 @@ def get_next_request(self) -> GenerationRequest:
64
66
return GenerationRequest (
65
67
request_type = settings .preferred_route ,
66
68
content = content ,
67
- stats = (
68
- {"prompt_tokens" : prompt_tokens } if prompt_tokens is not None else {}
69
- ),
70
- constraints = (
71
- {"output_tokens" : output_tokens } if output_tokens is not None else {}
72
- ),
69
+ stats = ({"prompt_tokens" : prompt_tokens } if prompt_tokens else {}),
70
+ constraints = ({"output_tokens" : output_tokens } if output_tokens else {}),
73
71
)
74
72
75
73
def get_next_delay (self ) -> float :
You can’t perform that action at this time.
0 commit comments