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
52b5f264
Commit
52b5f264
authored
Nov 27, 2025
by
luopl
Browse files
将qfeat添加到test2的server服务
parent
643c0d59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
vllm/entrypoints/openai/protocol.py
vllm/entrypoints/openai/protocol.py
+3
-1
vllm/entrypoints/openai/serving_engine.py
vllm/entrypoints/openai/serving_engine.py
+5
-4
No files found.
vllm/entrypoints/openai/protocol.py
View file @
52b5f264
...
...
@@ -1766,13 +1766,15 @@ class ClassificationRequest(OpenAIBaseModel):
)
activation
:
Optional
[
bool
]
=
None
qfeat
:
Optional
[
list
]
=
None
# --8<-- [end:classification-extra-params]
def
to_pooling_params
(
self
):
return
PoolingParams
(
truncate_prompt_tokens
=
self
.
truncate_prompt_tokens
,
activation
=
self
.
activation
)
activation
=
self
.
activation
,
qfeat
=
self
.
qfeat
)
class
ClassificationData
(
OpenAIBaseModel
):
...
...
vllm/entrypoints/openai/serving_engine.py
View file @
52b5f264
...
...
@@ -229,9 +229,9 @@ class OpenAIServing:
self
.
model_config
=
model_config
self
.
max_model_len
=
model_config
.
max_model_len
self
.
tokenizer_mode
=
model_config
.
tokenizer_mode
if
model_config
.
tokenizer_mode
==
"cpm"
:
self
.
tokenizer
=
CPM9GTokenizer
(
model_config
.
model
,
trust_remote_code
=
True
)
self
.
tokenizer
=
CPM9GTokenizer
(
model_config
.
model
,
trust_remote_code
=
True
)
self
.
models
=
models
...
...
@@ -380,7 +380,8 @@ class OpenAIServing:
for
i
,
engine_prompt
in
enumerate
(
ctx
.
engine_prompts
):
request_id_item
=
f
"
{
ctx
.
request_id
}
-
{
i
}
"
if
pooling_params
.
qfeat
is
not
None
:
engine_prompt
[
"qfeat"
]
=
pooling_params
.
qfeat
self
.
_log_inputs
(
request_id_item
,
engine_prompt
,
...
...
@@ -620,7 +621,7 @@ class OpenAIServing:
if
tokenizer
is
None
:
input_text
=
""
else
:
async_tokenizer
=
self
.
_get_async_tokenizer
(
tokenizer
)
async_tokenizer
=
self
.
_get_async_tokenizer
(
tokenizer
)
input_text
=
await
async_tokenizer
.
decode
(
input_ids
)
if
self
.
tokenizer_mode
!=
"cpm"
else
await
self
.
tokenizer
.
decode_all
(
input_ids
)
return
self
.
_validate_input
(
request
,
input_ids
,
input_text
)
...
...
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