File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -287,7 +287,7 @@ def __init__(self):
287287 return cache
288288
289289 torch ._check (
290- len (key_value_pairs ) == len (cache .layers ),
290+ not hasattr ( cache , "layers" ) or len (key_value_pairs ) == len (cache .layers ),
291291 lambda : (
292292 f"Length mismatch len(key_value_pairs)={ len (key_value_pairs )} , "
293293 f"len(cache.layers)={ len (cache .layers )} "
@@ -334,7 +334,10 @@ def make_encoder_decoder_cache(
334334) -> transformers .cache_utils .EncoderDecoderCache :
335335 """Creates an EncoderDecoderCache."""
336336 return transformers .cache_utils .EncoderDecoderCache (
337- self_attention_cache = self_attention_cache , cross_attention_cache = cross_attention_cache
337+ # self_attention_cache=self_attention_cache,
338+ # cross_attention_cache=cross_attention_cache
339+ self_attention_cache ,
340+ cross_attention_cache ,
338341 )
339342
340343
You can’t perform that action at this time.
0 commit comments