Unverified Commit 9451a385 authored by Sanchit Gandhi's avatar Sanchit Gandhi Committed by GitHub
Browse files

[enc-dec cache] fix bug in indexing (#32370)

parent 453e7488
...@@ -1034,7 +1034,7 @@ class EncoderDecoderCache(Cache): ...@@ -1034,7 +1034,7 @@ class EncoderDecoderCache(Cache):
self.self_attention_cache.key_cache[layer_idx], self.self_attention_cache.key_cache[layer_idx],
self.self_attention_cache.value_cache[layer_idx], self.self_attention_cache.value_cache[layer_idx],
self.cross_attention_cache.key_cache[layer_idx], self.cross_attention_cache.key_cache[layer_idx],
self.cross_attention_cache.key_cache[layer_idx], self.cross_attention_cache.value_cache[layer_idx],
) )
else: else:
raise KeyError(f"Cache only has {len(self)} layers, attempted to access layer with index {layer_idx}") raise KeyError(f"Cache only has {len(self)} layers, attempted to access layer with index {layer_idx}")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment