Skip to content

Commit a0ccd3c

Browse files
committed
🎨 cleanup
Signed-off-by: Joe Runde <[email protected]>
1 parent d91700d commit a0ccd3c

File tree

1 file changed

+3
-6
lines changed
  • src/vllm_tgis_adapter/tgis_utils

1 file changed

+3
-6
lines changed

src/vllm_tgis_adapter/tgis_utils/logs.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from vllm import PromptType, RequestOutput, SamplingParams
1919
from vllm.engine.protocol import EngineClient
20+
from vllm.sequence import RequestMetrics
2021

2122
logger = init_logger(__name__)
2223

@@ -97,7 +98,7 @@ async def generate_with_logging(*args, **kwargs) -> AsyncGenerator[RequestOutput
9798
if last:
9899
# Log the response
99100
with suppress(BaseException):
100-
_new_log_response(
101+
_log_response(
101102
request_id=request_id,
102103
correlation_id=correlation_id,
103104
response=last,
@@ -108,10 +109,6 @@ async def generate_with_logging(*args, **kwargs) -> AsyncGenerator[RequestOutput
108109
engine.generate = generate_with_logging
109110

110111

111-
if TYPE_CHECKING:
112-
from vllm.sequence import RequestMetrics
113-
114-
115112
def _log_error(request_id: str, correlation_id: str, exception_str: str) -> None:
116113
logger.error(
117114
"Request failed: request_id=%s correlation_id=%s error=%s",
@@ -143,7 +140,7 @@ def _log_request(
143140
)
144141

145142

146-
def _new_log_response(
143+
def _log_response(
147144
request_id: str,
148145
correlation_id: str,
149146
response: RequestOutput,

0 commit comments

Comments
 (0)