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
e7116c01
Unverified
Commit
e7116c01
authored
Oct 23, 2024
by
Cyrus Leung
Committed by
GitHub
Oct 23, 2024
Browse files
[Bugfix] Fix `_init_vision_model` in NVLM_D model (#9611)
Co-authored-by:
Isotr0py
<
2037008807@qq.com
>
parent
31a08f5b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
9 deletions
+28
-9
vllm/model_executor/models/nvlm_d.py
vllm/model_executor/models/nvlm_d.py
+28
-9
No files found.
vllm/model_executor/models/nvlm_d.py
View file @
e7116c01
...
...
@@ -58,12 +58,31 @@ class NVLM_D_Model(InternVLChatModel):
nn
.
Linear
(
llm_intermediate_size
,
llm_hidden_size
,
bias
=
False
),
)
def
_init_vision_model
(
self
,
config
:
PretrainedConfig
,
def
_init_vision_model
(
self
,
config
:
PretrainedConfig
,
quant_config
:
Optional
[
QuantizationConfig
],
num_hidden_layers
:
int
):
# We added additional dummy heads to the original num of heads to make
# the number of heads divisible by 8.
return
InternVisionModel
(
config
.
vision_config
,
*
,
is_mono
:
bool
,
prefix
:
str
,
):
if
not
is_mono
:
vision_feature_layer
=
config
.
select_layer
if
vision_feature_layer
<
0
:
num_hidden_layers
=
config
.
vision_config
.
num_hidden_layers
\
+
vision_feature_layer
+
1
else
:
num_hidden_layers
=
vision_feature_layer
+
1
# We added additional dummy heads to the original num of heads to
# make the number of heads divisible by 8.
return
InternVisionModel
(
config
.
vision_config
,
quant_config
=
quant_config
,
num_hidden_layers_override
=
num_hidden_layers
,
num_dummy_heads
=
7
)
num_dummy_heads
=
7
,
prefix
=
prefix
,
)
else
:
msg
=
"Monolith mode is not applicable to NVLM_D"
raise
NotImplementedError
(
msg
)
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