Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
9736caa9
Commit
9736caa9
authored
Nov 15, 2024
by
王敏
Browse files
[fix]回退test_long_context中限制输入长度修改
parent
fa57cb7f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
6 deletions
+0
-6
tests/lora/test_long_context.py
tests/lora/test_long_context.py
+0
-6
No files found.
tests/lora/test_long_context.py
View file @
9736caa9
...
@@ -81,9 +81,6 @@ def generate(
...
@@ -81,9 +81,6 @@ def generate(
inputs
:
Tuple
[
str
,
SamplingParams
,
Optional
[
LoRARequest
]],
inputs
:
Tuple
[
str
,
SamplingParams
,
Optional
[
LoRARequest
]],
):
):
prompts
,
sampling_param
,
lora_request
=
inputs
prompts
,
sampling_param
,
lora_request
=
inputs
max_model_len
=
llm
.
llm_engine
.
model_config
.
max_model_len
if
len
(
prompts
)
>=
max_model_len
:
prompts
=
prompts
[:
max_model_len
-
1
]
outputs
=
llm
.
generate
(
prompts
,
sampling_param
,
lora_request
=
lora_request
)
outputs
=
llm
.
generate
(
prompts
,
sampling_param
,
lora_request
=
lora_request
)
return
outputs
[
0
].
outputs
[
0
].
text
.
strip
()
return
outputs
[
0
].
outputs
[
0
].
text
.
strip
()
...
@@ -92,11 +89,8 @@ def batched_generate(
...
@@ -92,11 +89,8 @@ def batched_generate(
llm
:
vllm
.
LLM
,
llm
:
vllm
.
LLM
,
inputs
:
List
[
Tuple
[
str
,
SamplingParams
,
Optional
[
LoRARequest
]]],
inputs
:
List
[
Tuple
[
str
,
SamplingParams
,
Optional
[
LoRARequest
]]],
):
):
max_model_len
=
llm
.
llm_engine
.
model_config
.
max_model_len
for
input
in
inputs
:
for
input
in
inputs
:
prompt
,
sampling_param
,
lora_req
=
input
prompt
,
sampling_param
,
lora_req
=
input
if
len
(
prompt
)
>=
max_model_len
:
prompt
=
prompt
[:
max_model_len
-
1
]
# Add requests to the engine and run the engine
# Add requests to the engine and run the engine
llm
.
_validate_and_add_requests
(
prompt
,
llm
.
_validate_and_add_requests
(
prompt
,
sampling_param
,
sampling_param
,
...
...
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