File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
vllm/model_executor/models Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,9 @@ def __init__(self,
195195 is_neox_style = is_neox_style ,
196196 ) if not self .nope else None
197197
198- attn_cls = Attention if self .nope else ChunkedLocalAttention
198+ use_chunked_local_attn = not self .nope and config .attention_chunk_size
199+ attn_cls = (ChunkedLocalAttention
200+ if use_chunked_local_attn else Attention )
199201 self .attn = attn_cls (
200202 self .num_heads ,
201203 self .head_dim ,
@@ -206,7 +208,7 @@ def __init__(self,
206208 prefix = f"{ prefix } .attn" ,
207209 ** ({
208210 "attention_chunk_size" : config .attention_chunk_size
209- } if not self . nope else {}))
211+ } if use_chunked_local_attn else {}))
210212
211213 def _get_attn_scale (self , positions : torch .Tensor ) -> torch .Tensor :
212214 floor = torch .floor ((positions + 1.0 ) / self .floor_scale )
You can’t perform that action at this time.
0 commit comments