File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
vllm/model_executor/models Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -164,8 +164,8 @@ def __init__(
164
164
is_sliding = config .layer_types [layer_idx ] == "sliding_attention"
165
165
self .sliding_window = config .sliding_window if is_sliding else None
166
166
167
- # apply rotary embeddings to every layer
168
- self .apply_all_layers = not is_sliding
167
+ # apply rotary embeddings to every layer in full attention models
168
+ self .apply_rope_all_layers = "sliding_attention" not in config . layer_types
169
169
170
170
self .rotary_emb = get_rope (
171
171
self .head_dim ,
@@ -201,7 +201,7 @@ def forward(
201
201
k = self .k_norm (k )
202
202
k = k .flatten (- 2 , - 1 )
203
203
204
- if self .sliding_window or self .apply_all_layers :
204
+ if self .sliding_window or self .apply_rope_all_layers :
205
205
q , k = self .rotary_emb (positions , q , k )
206
206
attn_output = self .attn (q , k , v )
207
207
output , _ = self .o_proj (attn_output )
You can’t perform that action at this time.
0 commit comments