Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norm
vllm
Commits
5574081c
".github/vscode:/vscode.git/clone" did not exist on "96f5467b6adfe59a2b63bbcf1356ec736bb06769"
Unverified
Commit
5574081c
authored
Feb 21, 2024
by
Mustafa Eyceoz
Committed by
GitHub
Feb 21, 2024
Browse files
Added early stopping to completion APIs (#2939)
parent
d7f39648
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
vllm/entrypoints/openai/protocol.py
vllm/entrypoints/openai/protocol.py
+4
-0
No files found.
vllm/entrypoints/openai/protocol.py
View file @
5574081c
...
...
@@ -72,6 +72,7 @@ class ChatCompletionRequest(BaseModel):
top_k
:
Optional
[
int
]
=
-
1
ignore_eos
:
Optional
[
bool
]
=
False
use_beam_search
:
Optional
[
bool
]
=
False
early_stopping
:
Optional
[
bool
]
=
False
stop_token_ids
:
Optional
[
List
[
int
]]
=
Field
(
default_factory
=
list
)
skip_special_tokens
:
Optional
[
bool
]
=
True
spaces_between_special_tokens
:
Optional
[
bool
]
=
True
...
...
@@ -99,6 +100,7 @@ class ChatCompletionRequest(BaseModel):
top_k
=
self
.
top_k
,
ignore_eos
=
self
.
ignore_eos
,
use_beam_search
=
self
.
use_beam_search
,
early_stopping
=
self
.
early_stopping
,
skip_special_tokens
=
self
.
skip_special_tokens
,
spaces_between_special_tokens
=
self
.
spaces_between_special_tokens
,
include_stop_str_in_output
=
self
.
include_stop_str_in_output
,
...
...
@@ -129,6 +131,7 @@ class CompletionRequest(BaseModel):
top_k
:
Optional
[
int
]
=
-
1
ignore_eos
:
Optional
[
bool
]
=
False
use_beam_search
:
Optional
[
bool
]
=
False
early_stopping
:
Optional
[
bool
]
=
False
stop_token_ids
:
Optional
[
List
[
int
]]
=
Field
(
default_factory
=
list
)
skip_special_tokens
:
Optional
[
bool
]
=
True
spaces_between_special_tokens
:
Optional
[
bool
]
=
True
...
...
@@ -157,6 +160,7 @@ class CompletionRequest(BaseModel):
max_tokens
=
self
.
max_tokens
if
not
echo_without_generation
else
1
,
logprobs
=
self
.
logprobs
,
use_beam_search
=
self
.
use_beam_search
,
early_stopping
=
self
.
early_stopping
,
prompt_logprobs
=
self
.
logprobs
if
self
.
echo
else
None
,
skip_special_tokens
=
self
.
skip_special_tokens
,
spaces_between_special_tokens
=
(
self
.
spaces_between_special_tokens
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment