Skip to content

Commit

Permalink
Update api_server.py (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
909254 authored Feb 21, 2024
1 parent 21a6aae commit fb369db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lmdeploy/serve/openai/api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ async def chat_completions_v1(request: ChatCompletionRequest,
tokens. Only accept stop words that's encoded to one token idex.
Additional arguments supported by LMDeploy:
- top_k (int): The number of the highest probability vocabulary
tokens to keep for top-k-filtering
- ignore_eos (bool): indicator for ignoring eos
- skip_special_tokens (bool): Whether or not to remove special tokens
in the decoding. Default to be True.
Expand All @@ -303,6 +305,7 @@ async def chat_completions_v1(request: ChatCompletionRequest,

gen_config = GenerationConfig(
max_new_tokens=request.max_tokens if request.max_tokens else 512,
top_k=request.top_k,
top_p=request.top_p,
temperature=request.temperature,
repetition_penalty=request.repetition_penalty,
Expand Down

0 comments on commit fb369db

Please sign in to comment.