Skip to content

Commit 7a098b9

Browse files
committed
fix
1 parent cfce380 commit 7a098b9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

onnx_diagnostic/helpers/cache_helper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,10 @@ def make_encoder_decoder_cache(
537537
make_encoder_decoder_cache = None # type: ignore[assignment]
538538

539539

540-
if hasattr(transformers.cache_utils, "SlidingWindowCache"):
540+
if (
541+
hasattr(transformers.cache_utils, "SlidingWindowCache")
542+
and transformers.cache_utils.SlidingWindowCache.__name__ == "SlidingWindowCache"
543+
):
541544

542545
def make_sliding_window_cache(
543546
key_value_pairs: Union[List[torch.Tensor], List[Tuple[torch.Tensor, torch.Tensor]]],

0 commit comments

Comments
 (0)