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
46ce1356
Commit
46ce1356
authored
Feb 24, 2023
by
Woosuk Kwon
Browse files
Add max_num_steps to SamplingParams
parent
b39f149a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
cacheflow/sampling_params.py
cacheflow/sampling_params.py
+3
-0
No files found.
cacheflow/sampling_params.py
View file @
46ce1356
...
...
@@ -10,6 +10,7 @@ class SamplingParams:
top_p
:
float
=
1.0
,
use_beam_search
:
bool
=
False
,
stop_token_ids
:
Set
[
int
]
=
[],
max_num_steps
:
int
=
16
,
# From OpenAI API.
max_context_len
:
Optional
[
int
]
=
None
,
)
->
None
:
assert
n
>=
1
...
...
@@ -23,6 +24,7 @@ class SamplingParams:
# Zero temperature means greedy decoding.
assert
n
==
1
assert
top_p
==
1.0
assert
max_num_steps
>=
1
assert
max_context_len
is
None
or
max_context_len
>=
0
self
.
n
=
n
...
...
@@ -30,4 +32,5 @@ class SamplingParams:
self
.
top_p
=
top_p
self
.
use_beam_search
=
use_beam_search
self
.
stop_token_ids
=
stop_token_ids
self
.
max_num_steps
=
max_num_steps
self
.
max_context_len
=
max_context_len
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