Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
zifeitong committed Jul 30, 2024
1 parent ebbdcdb commit ff3e004
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions vllm/entrypoints/openai/serving_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@ async def create_chat_completion(
sampling_params = request.to_sampling_params(
tokenizer, guided_decode_logits_processor)
if sampling_params.max_tokens is None:
sampling_params.max_tokens = (
self.max_model_len -
len(prompt_inputs["prompt_token_ids"]))
sampling_params.max_tokens = \
self.max_model_len - len(prompt_inputs["prompt_token_ids"])

self._log_inputs(request_id,
prompt_inputs,
Expand Down
5 changes: 2 additions & 3 deletions vllm/entrypoints/openai/serving_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ async def create_completion(self, request: CompletionRequest,
sampling_params = request.to_sampling_params(
tokenizer, guided_decode_logits_processor)
if sampling_params.max_tokens is None:
sampling_params.max_tokens = (
self.max_model_len -
len(prompt_inputs["prompt_token_ids"]))
sampling_params.max_tokens = self.max_model_len - \
len(prompt_inputs["prompt_token_ids"])

request_id_item = f"{request_id}-{i}"

Expand Down

0 comments on commit ff3e004

Please sign in to comment.