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
9c62db07
Unverified
Commit
9c62db07
authored
Jun 22, 2024
by
Jie Fu (傅杰)
Committed by
GitHub
Jun 22, 2024
Browse files
[Model] Support Qwen-VL and Qwen-VL-Chat models with text-only inputs (#5710)
Co-authored-by:
Roger Wang
<
ywang@roblox.com
>
parent
cf90ae01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
vllm/model_executor/models/qwen.py
vllm/model_executor/models/qwen.py
+10
-0
No files found.
vllm/model_executor/models/qwen.py
View file @
9c62db07
...
@@ -28,6 +28,7 @@ from vllm.model_executor.layers.vocab_parallel_embedding import (
...
@@ -28,6 +28,7 @@ from vllm.model_executor.layers.vocab_parallel_embedding import (
from
vllm.model_executor.model_loader.weight_utils
import
default_weight_loader
from
vllm.model_executor.model_loader.weight_utils
import
default_weight_loader
from
vllm.model_executor.sampling_metadata
import
SamplingMetadata
from
vllm.model_executor.sampling_metadata
import
SamplingMetadata
from
vllm.sequence
import
SamplerOutput
from
vllm.sequence
import
SamplerOutput
from
vllm.utils
import
print_warning_once
class
QWenMLP
(
nn
.
Module
):
class
QWenMLP
(
nn
.
Module
):
...
@@ -288,6 +289,15 @@ class QWenLMHeadModel(nn.Module):
...
@@ -288,6 +289,15 @@ class QWenLMHeadModel(nn.Module):
# Skip loading extra bias for GPTQ models.
# Skip loading extra bias for GPTQ models.
if
name
.
endswith
(
".bias"
)
and
name
not
in
params_dict
:
if
name
.
endswith
(
".bias"
)
and
name
not
in
params_dict
:
continue
continue
# Skip loading visual weights to support Qwen-VL models
# in cases with text-only inputs
# TODO: add support for Qwen-VL
if
(
name
not
in
params_dict
and
name
.
startswith
(
"transformer.visual."
)):
print_warning_once
(
"Only text inputs are allowed. Images won't be handled "
"until Qwen-VL models are fully supported."
)
continue
param
=
params_dict
[
name
]
param
=
params_dict
[
name
]
weight_loader
=
getattr
(
param
,
"weight_loader"
,
weight_loader
=
getattr
(
param
,
"weight_loader"
,
default_weight_loader
)
default_weight_loader
)
...
...
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