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
bd4c1e6f
Unverified
Commit
bd4c1e6f
authored
Jul 13, 2025
by
Minkyu Kim
Committed by
GitHub
Jul 13, 2025
Browse files
Support for LlamaForSequenceClassification (#20807)
Signed-off-by:
thechaos16
<
thechaos16@gmail.com
>
parent
99b4f080
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
tests/models/registry.py
tests/models/registry.py
+1
-0
vllm/model_executor/models/llama.py
vllm/model_executor/models/llama.py
+4
-0
vllm/model_executor/models/registry.py
vllm/model_executor/models/registry.py
+2
-1
No files found.
tests/models/registry.py
View file @
bd4c1e6f
...
@@ -330,6 +330,7 @@ _CROSS_ENCODER_EXAMPLE_MODELS = {
...
@@ -330,6 +330,7 @@ _CROSS_ENCODER_EXAMPLE_MODELS = {
hf_overrides
=
{
"architectures"
:
[
"GemmaForSequenceClassification"
],
# noqa: E501
hf_overrides
=
{
"architectures"
:
[
"GemmaForSequenceClassification"
],
# noqa: E501
"classifier_from_token"
:
[
"Yes"
],
# noqa: E501
"classifier_from_token"
:
[
"Yes"
],
# noqa: E501
"method"
:
"no_post_processing"
}),
# noqa: E501
"method"
:
"no_post_processing"
}),
# noqa: E501
"LlamaForSequenceClassification"
:
_HfExamplesInfo
(
"Skywork/Skywork-Reward-V2-Llama-3.2-1B"
),
# noqa: E501
"ModernBertForSequenceClassification"
:
_HfExamplesInfo
(
"Alibaba-NLP/gte-reranker-modernbert-base"
,
v0_only
=
True
),
# noqa: E501
"ModernBertForSequenceClassification"
:
_HfExamplesInfo
(
"Alibaba-NLP/gte-reranker-modernbert-base"
,
v0_only
=
True
),
# noqa: E501
"RobertaForSequenceClassification"
:
_HfExamplesInfo
(
"cross-encoder/quora-roberta-base"
,
v0_only
=
True
),
# noqa: E501
"RobertaForSequenceClassification"
:
_HfExamplesInfo
(
"cross-encoder/quora-roberta-base"
,
v0_only
=
True
),
# noqa: E501
"XLMRobertaForSequenceClassification"
:
_HfExamplesInfo
(
"BAAI/bge-reranker-v2-m3"
,
v0_only
=
True
),
# noqa: E501
"XLMRobertaForSequenceClassification"
:
_HfExamplesInfo
(
"BAAI/bge-reranker-v2-m3"
,
v0_only
=
True
),
# noqa: E501
...
...
vllm/model_executor/models/llama.py
View file @
bd4c1e6f
...
@@ -49,6 +49,7 @@ from vllm.model_executor.model_loader.weight_utils import (
...
@@ -49,6 +49,7 @@ from vllm.model_executor.model_loader.weight_utils import (
from
vllm.model_executor.sampling_metadata
import
SamplingMetadata
from
vllm.model_executor.sampling_metadata
import
SamplingMetadata
from
vllm.sequence
import
IntermediateTensors
from
vllm.sequence
import
IntermediateTensors
from
.adapters
import
as_seq_cls_model
from
.interfaces
import
SupportsLoRA
,
SupportsPP
from
.interfaces
import
SupportsLoRA
,
SupportsPP
from
.utils
import
(
AutoWeightsLoader
,
PPMissingLayer
,
extract_layer_index
,
from
.utils
import
(
AutoWeightsLoader
,
PPMissingLayer
,
extract_layer_index
,
is_pp_missing_parameter
,
is_pp_missing_parameter
,
...
@@ -645,3 +646,6 @@ class LlamaForCausalLM(nn.Module, SupportsLoRA, SupportsPP):
...
@@ -645,3 +646,6 @@ class LlamaForCausalLM(nn.Module, SupportsLoRA, SupportsPP):
name
=
name
.
replace
(
item
,
mapping
[
item
])
name
=
name
.
replace
(
item
,
mapping
[
item
])
return
name
,
loaded_weight
return
name
,
loaded_weight
LlamaForSequenceClassification
=
as_seq_cls_model
(
LlamaForCausalLM
)
vllm/model_executor/models/registry.py
View file @
bd4c1e6f
...
@@ -183,7 +183,8 @@ _CROSS_ENCODER_MODELS = {
...
@@ -183,7 +183,8 @@ _CROSS_ENCODER_MODELS = {
"GemmaForSequenceClassification"
:
(
"gemma"
,
"GemmaForSequenceClassification"
),
# noqa: E501
"GemmaForSequenceClassification"
:
(
"gemma"
,
"GemmaForSequenceClassification"
),
# noqa: E501
"Qwen2ForSequenceClassification"
:
(
"qwen2"
,
"Qwen2ForSequenceClassification"
),
# noqa: E501
"Qwen2ForSequenceClassification"
:
(
"qwen2"
,
"Qwen2ForSequenceClassification"
),
# noqa: E501
"Qwen3ForSequenceClassification"
:
(
"qwen3"
,
"Qwen3ForSequenceClassification"
),
# noqa: E501
"Qwen3ForSequenceClassification"
:
(
"qwen3"
,
"Qwen3ForSequenceClassification"
),
# noqa: E501
"JinaVLForRanking"
:
(
"jina_vl"
,
"JinaVLForSequenceClassification"
),
# noqa: E501
"LlamaForSequenceClassification"
:
(
"llama"
,
"LlamaForSequenceClassification"
),
# noqa: E501
"JinaVLForRanking"
:
(
"jina_vl"
,
"JinaVLForSequenceClassification"
),
# noqa: E501,
}
}
_MULTIMODAL_MODELS
=
{
_MULTIMODAL_MODELS
=
{
...
...
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