Skip to content

Commit

Permalink
more yapf formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdebayser committed Apr 1, 2024
1 parent 5f1cef2 commit ad39912
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions vllm/entrypoints/grpc/grpc_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,12 @@
SamplingParams)
from vllm.config import ModelConfig
from vllm.entrypoints.grpc.pb import generation_pb2_grpc
from vllm.entrypoints.grpc.pb.generation_pb2 import (BatchedGenerationRequest,
BatchedGenerationResponse,
BatchedTokenizeRequest,
BatchedTokenizeResponse,
DecodingMethod,
GenerationResponse,
ModelInfoRequest,
ModelInfoResponse,
Parameters,
ResponseOptions,
SingleGenerationRequest,
StopReason, TokenInfo,
TokenizeResponse)
from vllm.entrypoints.grpc.pb.generation_pb2 import (
BatchedGenerationRequest, BatchedGenerationResponse,
BatchedTokenizeRequest, BatchedTokenizeResponse, DecodingMethod,
GenerationResponse, ModelInfoRequest, ModelInfoResponse, Parameters,
ResponseOptions, SingleGenerationRequest, StopReason, TokenInfo,
TokenizeResponse)
from vllm.entrypoints.grpc.validation import validate_input, validate_params
from vllm.entrypoints.openai.serving_completion import merge_async_iterators
from vllm.logger import init_logger
Expand Down Expand Up @@ -314,16 +307,15 @@ async def _validate_and_convert_params(

if not greedy and 0.0 < sampling.typical_p < 1.0:
logits_processors.append(
TypicalLogitsWarperWrapper(mass=sampling.typical_p)
)
TypicalLogitsWarperWrapper(mass=sampling.typical_p))
if params.decoding.length_penalty is not None:
length_penalty = (
params.decoding.length_penalty.start_index,
params.decoding.length_penalty.decay_factor,
)
logits_processors.append(
LengthPenaltyWarper(length_penalty=length_penalty,
eos_token_id=self.tokenizer.eos_token_id))
eos_token_id=self.tokenizer.eos_token_id))

time_limit_millis = stopping.time_limit_millis
deadline = time.time(
Expand Down

0 comments on commit ad39912

Please sign in to comment.