@@ -262,7 +262,6 @@ def forward(
262
262
key_states = key_states .view (bsz , q_len , self .num_key_value_heads , self .head_dim ).transpose (1 , 2 )
263
263
value_states = value_states .view (bsz , q_len , self .num_key_value_heads , self .head_dim ).transpose (1 , 2 )
264
264
265
- past_key_value = getattr (self , "past_key_value" , past_key_value )
266
265
cos , sin = self .rotary_emb (value_states , position_ids , seq_len = None )
267
266
query_states , key_states = apply_rotary_pos_emb (query_states , key_states , cos , sin , None )
268
267
@@ -353,8 +352,6 @@ def forward(
353
352
cos , sin = self .rotary_emb (value_states , position_ids , seq_len = None )
354
353
query_states , key_states = apply_rotary_pos_emb (query_states , key_states , cos , sin , None )
355
354
356
- past_key_value = getattr (self , "past_key_value" , past_key_value )
357
-
358
355
if past_key_value is not None :
359
356
# sin and cos are specific to RoPE models; cache_position needed for the static cache
360
357
cache_kwargs = {"sin" : sin , "cos" : cos , "cache_position" : cache_position }
@@ -552,8 +549,6 @@ def forward(
552
549
cos , sin = self .rotary_emb (value_states , position_ids , seq_len = None )
553
550
query_states , key_states = apply_rotary_pos_emb (query_states , key_states , cos , sin , None )
554
551
555
- past_key_value = getattr (self , "past_key_value" , past_key_value )
556
-
557
552
if past_key_value is not None :
558
553
# sin and cos are specific to RoPE models; cache_position needed for the static cache
559
554
cache_kwargs = {"sin" : sin , "cos" : cos , "cache_position" : cache_position }
0 commit comments