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
c9f7081f
Unverified
Commit
c9f7081f
authored
Sep 04, 2025
by
Yash Pratap Singh
Committed by
GitHub
Sep 04, 2025
Browse files
[LoRA]: Add lora support to qwen-2.5-omni (#24231)
parent
16ded21e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
docs/models/supported_models.md
docs/models/supported_models.md
+1
-1
vllm/model_executor/models/qwen2_5_omni_thinker.py
vllm/model_executor/models/qwen2_5_omni_thinker.py
+13
-2
No files found.
docs/models/supported_models.md
View file @
c9f7081f
...
@@ -662,7 +662,7 @@ These models primarily accept the [`LLM.generate`](./generative_models.md#llmgen
...
@@ -662,7 +662,7 @@ These models primarily accept the [`LLM.generate`](./generative_models.md#llmgen
|
`Qwen2AudioForConditionalGeneration`
| Qwen2-Audio | T + A
<sup>
+
</sup>
|
`Qwen/Qwen2-Audio-7B-Instruct`
| | ✅︎ | ✅︎ |
|
`Qwen2AudioForConditionalGeneration`
| Qwen2-Audio | T + A
<sup>
+
</sup>
|
`Qwen/Qwen2-Audio-7B-Instruct`
| | ✅︎ | ✅︎ |
|
`Qwen2VLForConditionalGeneration`
| QVQ, Qwen2-VL | T + I
<sup>
E+
</sup>
+ V
<sup>
E+
</sup>
|
`Qwen/QVQ-72B-Preview`
,
`Qwen/Qwen2-VL-7B-Instruct`
,
`Qwen/Qwen2-VL-72B-Instruct`
, etc. | ✅︎ | ✅︎ | ✅︎ |
|
`Qwen2VLForConditionalGeneration`
| QVQ, Qwen2-VL | T + I
<sup>
E+
</sup>
+ V
<sup>
E+
</sup>
|
`Qwen/QVQ-72B-Preview`
,
`Qwen/Qwen2-VL-7B-Instruct`
,
`Qwen/Qwen2-VL-72B-Instruct`
, etc. | ✅︎ | ✅︎ | ✅︎ |
|
`Qwen2_5_VLForConditionalGeneration`
| Qwen2.5-VL | T + I
<sup>
E+
</sup>
+ V
<sup>
E+
</sup>
|
`Qwen/Qwen2.5-VL-3B-Instruct`
,
`Qwen/Qwen2.5-VL-72B-Instruct`
, etc. | ✅︎ | ✅︎ | ✅︎ |
|
`Qwen2_5_VLForConditionalGeneration`
| Qwen2.5-VL | T + I
<sup>
E+
</sup>
+ V
<sup>
E+
</sup>
|
`Qwen/Qwen2.5-VL-3B-Instruct`
,
`Qwen/Qwen2.5-VL-72B-Instruct`
, etc. | ✅︎ | ✅︎ | ✅︎ |
|
`Qwen2_5OmniThinkerForConditionalGeneration`
| Qwen2.5-Omni | T + I
<sup>
E+
</sup>
+ V
<sup>
E+
</sup>
+ A
<sup>
+
</sup>
|
`Qwen/Qwen2.5-Omni-7B`
| | ✅︎ | ✅︎ |
|
`Qwen2_5OmniThinkerForConditionalGeneration`
| Qwen2.5-Omni | T + I
<sup>
E+
</sup>
+ V
<sup>
E+
</sup>
+ A
<sup>
+
</sup>
|
`Qwen/Qwen2.5-Omni-3B`
,
`Qwen/Qwen2.5-Omni-7B`
|
✅︎
| ✅︎ | ✅︎ |
|
`RForConditionalGeneration`
| R-VL-4B | T + I
<sup>
E+
</sup>
|
`YannQi/R-4B`
| | ✅︎ | ✅︎ |
|
`RForConditionalGeneration`
| R-VL-4B | T + I
<sup>
E+
</sup>
|
`YannQi/R-4B`
| | ✅︎ | ✅︎ |
|
`SkyworkR1VChatModel`
| Skywork-R1V-38B | T + I |
`Skywork/Skywork-R1V-38B`
| | ✅︎ | ✅︎ |
|
`SkyworkR1VChatModel`
| Skywork-R1V-38B | T + I |
`Skywork/Skywork-R1V-38B`
| | ✅︎ | ✅︎ |
|
`SmolVLMForConditionalGeneration`
| SmolVLM2 | T + I |
`SmolVLM2-2.2B-Instruct`
| ✅︎ | | ✅︎ |
|
`SmolVLMForConditionalGeneration`
| SmolVLM2 | T + I |
`SmolVLM2-2.2B-Instruct`
| ✅︎ | | ✅︎ |
...
...
vllm/model_executor/models/qwen2_5_omni_thinker.py
View file @
c9f7081f
...
@@ -41,6 +41,7 @@ from transformers.models.whisper import WhisperFeatureExtractor
...
@@ -41,6 +41,7 @@ from transformers.models.whisper import WhisperFeatureExtractor
from
vllm.config
import
VllmConfig
from
vllm.config
import
VllmConfig
from
vllm.logger
import
init_logger
from
vllm.logger
import
init_logger
from
vllm.model_executor.layers.rotary_embedding
import
MRotaryEmbedding
from
vllm.model_executor.layers.rotary_embedding
import
MRotaryEmbedding
from
vllm.model_executor.models.module_mapping
import
MultiModelKeys
from
vllm.model_executor.models.qwen2_5_vl
import
(
from
vllm.model_executor.models.qwen2_5_vl
import
(
Qwen2_5_VisionTransformer
,
Qwen2_5_VLImageEmbeddingInputs
,
Qwen2_5_VisionTransformer
,
Qwen2_5_VLImageEmbeddingInputs
,
Qwen2_5_VLImageInputs
,
Qwen2_5_VLImagePixelInputs
,
Qwen2_5_VLImageInputs
,
Qwen2_5_VLImagePixelInputs
,
...
@@ -66,7 +67,8 @@ from vllm.multimodal.profiling import BaseDummyInputsBuilder
...
@@ -66,7 +67,8 @@ from vllm.multimodal.profiling import BaseDummyInputsBuilder
from
vllm.sequence
import
IntermediateTensors
from
vllm.sequence
import
IntermediateTensors
from
vllm.transformers_utils.tokenizer
import
decode_tokens
,
encode_tokens
from
vllm.transformers_utils.tokenizer
import
decode_tokens
,
encode_tokens
from
.interfaces
import
MultiModalEmbeddings
,
SupportsMultiModal
,
SupportsPP
from
.interfaces
import
(
MultiModalEmbeddings
,
SupportsLoRA
,
SupportsMultiModal
,
SupportsPP
)
from
.utils
import
(
AutoWeightsLoader
,
WeightsMapper
,
from
.utils
import
(
AutoWeightsLoader
,
WeightsMapper
,
init_vllm_registered_model
,
maybe_prefix
,
init_vllm_registered_model
,
maybe_prefix
,
merge_multimodal_embeddings
)
merge_multimodal_embeddings
)
...
@@ -705,7 +707,7 @@ class Qwen2_5OmniConditionalGenerationMixin:
...
@@ -705,7 +707,7 @@ class Qwen2_5OmniConditionalGenerationMixin:
dummy_inputs
=
Qwen2_5OmniThinkerDummyInputsBuilder
,
dummy_inputs
=
Qwen2_5OmniThinkerDummyInputsBuilder
,
)
)
class
Qwen2_5OmniThinkerForConditionalGeneration
(
class
Qwen2_5OmniThinkerForConditionalGeneration
(
nn
.
Module
,
SupportsMultiModal
,
SupportsPP
,
nn
.
Module
,
SupportsMultiModal
,
SupportsPP
,
SupportsLoRA
,
Qwen2_5OmniConditionalGenerationMixin
):
Qwen2_5OmniConditionalGenerationMixin
):
hf_to_vllm_mapper
=
WeightsMapper
(
hf_to_vllm_mapper
=
WeightsMapper
(
orig_to_new_prefix
=
{
orig_to_new_prefix
=
{
...
@@ -798,6 +800,15 @@ class Qwen2_5OmniThinkerForConditionalGeneration(
...
@@ -798,6 +800,15 @@ class Qwen2_5OmniThinkerForConditionalGeneration(
def
get_language_model
(
self
)
->
torch
.
nn
.
Module
:
def
get_language_model
(
self
)
->
torch
.
nn
.
Module
:
return
self
.
language_model
return
self
.
language_model
def
get_mm_mapping
(
self
)
->
MultiModelKeys
:
"""Get module prefix for multimodal models to filter LoRA modules."""
return
MultiModelKeys
.
from_string_field
(
language_model
=
"language_model"
,
connector
=
[],
# No explicit connector in this model
tower_model
=
[
"visual"
,
"audio_tower"
],
# Exclude vision and audio towers
)
def
get_multimodal_embeddings
(
self
,
def
get_multimodal_embeddings
(
self
,
**
kwargs
:
object
)
->
MultiModalEmbeddings
:
**
kwargs
:
object
)
->
MultiModalEmbeddings
:
...
...
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