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
change
sglang
Commits
fa7a696d
Commit
fa7a696d
authored
Jan 24, 2024
by
Lianmin Zheng
Browse files
Fix max_new_tokens for limited memory
parent
bef0b359
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
python/sglang/srt/managers/router/model_rpc.py
python/sglang/srt/managers/router/model_rpc.py
+1
-0
No files found.
python/sglang/srt/managers/router/model_rpc.py
View file @
fa7a696d
...
...
@@ -229,6 +229,7 @@ class ModelRpcServer(rpyc.Service):
req
.
sampling_params
.
max_new_tokens
=
min
(
req
.
sampling_params
.
max_new_tokens
,
self
.
model_config
.
context_len
-
1
-
len
(
req
.
input_ids
),
self
.
max_total_num_token
-
128
-
len
(
req
.
input_ids
),
)
self
.
forward_queue
.
append
(
req
)
...
...
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