Skip to content

Commit f38df5a

Browse files
WoosukKwonjimpang
authored andcommitted
[Fix] Fix RoPE in ChatGLM-32K (vllm-project#1841)
1 parent fe53b79 commit f38df5a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vllm/model_executor/models/chatglm.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,17 @@ def __init__(
7575
linear_method=linear_method,
7676
)
7777

78+
# https://huggingface.co/THUDM/chatglm3-6b-32k/blob/e210410255278dd9d74463cf396ba559c0ef801c/modeling_chatglm.py#L141
79+
rope_ratio = getattr(config, "rope_ratio", 1.0)
80+
max_positions = getattr(config, "seq_length", 8192)
7881
self.attn = PagedAttentionWithRoPE(
7982
self.num_heads,
8083
self.head_dim,
8184
self.scaling,
8285
rotary_dim=self.head_dim // 2,
8386
num_kv_heads=self.num_kv_heads,
87+
max_position=max_positions,
88+
base=10000 * rope_ratio,
8489
is_neox_style=False,
8590
)
8691

0 commit comments

Comments
 (0)