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
77ae0f0d
Commit
77ae0f0d
authored
Nov 28, 2024
by
zhuwenwen
Browse files
update lm_head layout of chatglm
parent
2ff1c360
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
vllm/model_executor/models/chatglm.py
vllm/model_executor/models/chatglm.py
+6
-1
No files found.
vllm/model_executor/models/chatglm.py
View file @
77ae0f0d
...
@@ -697,7 +697,6 @@ class ChatGLMForCausalLM(nn.Module, SupportsLoRA, SupportsMultiModal):
...
@@ -697,7 +697,6 @@ class ChatGLMForCausalLM(nn.Module, SupportsLoRA, SupportsMultiModal):
"self_attention.dense.weight"
,
"self_attention.dense.weight"
,
"mlp.dense_h_to_4h.weight"
,
"mlp.dense_h_to_4h.weight"
,
"mlp.dense_4h_to_h.weight"
,
"mlp.dense_4h_to_h.weight"
,
"lm_head.weight"
]
]
combined_words
=
"|"
.
join
(
lay_key_words
)
combined_words
=
"|"
.
join
(
lay_key_words
)
...
@@ -708,6 +707,12 @@ class ChatGLMForCausalLM(nn.Module, SupportsLoRA, SupportsMultiModal):
...
@@ -708,6 +707,12 @@ class ChatGLMForCausalLM(nn.Module, SupportsLoRA, SupportsMultiModal):
qkv_bias_words
=
"|"
.
join
(
lay_qkv_bias_words
)
qkv_bias_words
=
"|"
.
join
(
lay_qkv_bias_words
)
for
layername
,
weight
in
params_dict
.
items
():
for
layername
,
weight
in
params_dict
.
items
():
if
"lm_head.weight"
in
layername
and
weight
.
shape
[
1
]
==
4096
:
lay_key_words
.
append
(
"lm_head.weight"
)
combined_words
=
"|"
.
join
(
lay_key_words
)
os
.
environ
[
'LM_NN'
]
=
'1'
else
:
os
.
environ
[
'LM_NN'
]
=
'0'
if
self
.
use_fa_pad
and
(
re
.
findall
(
qkv_bias_words
,
layername
)):
if
self
.
use_fa_pad
and
(
re
.
findall
(
qkv_bias_words
,
layername
)):
weight
.
data
=
pad_weight
(
weight
.
data
,
32
)
weight
.
data
=
pad_weight
(
weight
.
data
,
32
)
...
...
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