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
55d6d3fd
Unverified
Commit
55d6d3fd
authored
Apr 21, 2025
by
Isotr0py
Committed by
GitHub
Apr 21, 2025
Browse files
[Bugfix] Fix GLM rotary_dim issue and support v1 (#16912)
Signed-off-by:
isotr0py
<
2037008807@qq.com
>
parent
7272bfae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
vllm/model_executor/models/glm.py
vllm/model_executor/models/glm.py
+2
-3
No files found.
vllm/model_executor/models/glm.py
View file @
55d6d3fd
...
...
@@ -3,13 +3,13 @@
from
vllm.config
import
VllmConfig
from
vllm.model_executor.models.llama
import
LlamaForCausalLM
from
.interfaces
import
SupportsV0Only
from
.utils
import
PPMissingLayer
class
GlmForCausalLM
(
LlamaForCausalLM
,
SupportsV0Only
):
class
GlmForCausalLM
(
LlamaForCausalLM
):
def
__init__
(
self
,
*
,
vllm_config
:
VllmConfig
,
prefix
:
str
=
""
):
vllm_config
.
model_config
.
hf_config
.
partial_rotary_factor
=
0.5
super
().
__init__
(
vllm_config
=
vllm_config
,
prefix
=
prefix
)
# Hack Llama model to fit HF format GLM implementation
# Attention difference between GLM and Llama:
...
...
@@ -17,7 +17,6 @@ class GlmForCausalLM(LlamaForCausalLM, SupportsV0Only):
# 2. There is no bias for o_proj in attention
for
layer
in
self
.
model
.
layers
:
if
not
isinstance
(
layer
,
PPMissingLayer
):
layer
.
self_attn
.
rotary_emb
.
rotary_dim
//=
2
layer
.
self_attn
.
rotary_emb
.
is_neox_style
=
False
layer
.
self_attn
.
o_proj
.
bias
=
None
layer
.
self_attn
.
o_proj
.
skip_bias_add
=
True
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