Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norm
vllm
Commits
a7b3e330
Unverified
Commit
a7b3e330
authored
Nov 29, 2023
by
Woosuk Kwon
Committed by
GitHub
Nov 29, 2023
Browse files
[Fix] Fix RoPE in ChatGLM-32K (#1841)
parent
e19a64c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
vllm/model_executor/models/chatglm.py
vllm/model_executor/models/chatglm.py
+5
-0
No files found.
vllm/model_executor/models/chatglm.py
View file @
a7b3e330
...
@@ -75,12 +75,17 @@ class GLMAttention(nn.Module):
...
@@ -75,12 +75,17 @@ class GLMAttention(nn.Module):
linear_method
=
linear_method
,
linear_method
=
linear_method
,
)
)
# https://huggingface.co/THUDM/chatglm3-6b-32k/blob/e210410255278dd9d74463cf396ba559c0ef801c/modeling_chatglm.py#L141
rope_ratio
=
getattr
(
config
,
"rope_ratio"
,
1.0
)
max_positions
=
getattr
(
config
,
"seq_length"
,
8192
)
self
.
attn
=
PagedAttentionWithRoPE
(
self
.
attn
=
PagedAttentionWithRoPE
(
self
.
num_heads
,
self
.
num_heads
,
self
.
head_dim
,
self
.
head_dim
,
self
.
scaling
,
self
.
scaling
,
rotary_dim
=
self
.
head_dim
//
2
,
rotary_dim
=
self
.
head_dim
//
2
,
num_kv_heads
=
self
.
num_kv_heads
,
num_kv_heads
=
self
.
num_kv_heads
,
max_position
=
max_positions
,
base
=
10000
*
rope_ratio
,
is_neox_style
=
False
,
is_neox_style
=
False
,
)
)
...
...
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