Skip to content

Commit 453b5d4

Browse files
Cyrilvallezzaristei
authored andcommitted
Add missing flag for CacheLayer (huggingface#39678)
* fix * Update cache_utils.py
1 parent 268e417 commit 453b5d4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/transformers/cache_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ class DynamicLayer(CacheLayerMixin):
7373
See `CacheLayerMixin` for details on common methods that are implemented by all cache layers.
7474
"""
7575

76+
is_sliding = False
77+
7678
def update(
7779
self,
7880
key_states: torch.Tensor,
@@ -307,6 +309,8 @@ class SlidingWindowLayer(StaticLayer):
307309
See `CacheLayerMixin` for details on common methods that are implemented by all cache layers.
308310
"""
309311

312+
is_sliding = True
313+
310314
def __init__(self, sliding_window, *args, **kwargs):
311315
"""
312316
Args:

0 commit comments

Comments
 (0)