Skip to content

Commit 459c1fa

Browse files
authored
refactor: use tolist instead of list comprehension calling .item() (#40646)
1 parent afd1393 commit 459c1fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transformers/commands/serving.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ def continuous_batching_chat_completion(self, req: dict) -> Generator[str, None,
834834

835835
def stream_chat_completion(_inputs):
836836
try:
837-
decode_stream = DecodeStream([id.item() for id in _inputs], False)
837+
decode_stream = DecodeStream(_inputs.tolist(), False)
838838
request_id = self.running_continuous_batching_manager.add_request(
839839
_inputs, request_id=req.get("request_id"), max_new_tokens=generation_config.max_new_tokens
840840
)

0 commit comments

Comments
 (0)