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
d0945122
Commit
d0945122
authored
Feb 23, 2023
by
Woosuk Kwon
Browse files
Move max_context_len
parent
4b1ac23f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
cacheflow/decoding.py
cacheflow/decoding.py
+5
-2
cacheflow/sequence.py
cacheflow/sequence.py
+0
-2
No files found.
cacheflow/decoding.py
View file @
d0945122
from
typing
import
Lis
t
from
typing
import
Optional
,
Se
t
class
DecodingParams
:
...
...
@@ -9,7 +9,8 @@ class DecodingParams:
temperature
:
float
=
1.0
,
top_p
:
float
=
1.0
,
use_beam_search
:
bool
=
False
,
stop_token_ids
:
List
[
int
]
=
[],
stop_token_ids
:
Set
[
int
]
=
[],
max_context_len
:
Optional
[
int
]
=
None
,
)
->
None
:
assert
n
>=
1
assert
temperature
>=
0.0
...
...
@@ -22,9 +23,11 @@ class DecodingParams:
# Zero temperature means greedy decoding.
assert
n
==
1
assert
top_p
==
1.0
assert
max_context_len
is
None
or
max_context_len
>=
0
self
.
n
=
n
self
.
temperature
=
temperature
self
.
top_p
=
top_p
self
.
use_beam_search
=
use_beam_search
self
.
stop_token_ids
=
stop_token_ids
self
.
max_context_len
=
max_context_len
cacheflow/sequence.py
View file @
d0945122
...
...
@@ -17,11 +17,9 @@ class Sequence:
self
,
seq_id
:
int
,
token_ids
:
List
[
int
],
max_context_len
:
int
,
block_size
:
int
,
)
->
None
:
self
.
seq_id
=
seq_id
self
.
max_context_len
=
max_context_len
self
.
block_size
=
block_size
self
.
logical_token_blocks
:
List
[
LogicalTokenBlock
]
=
[]
...
...
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