We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Index_copy
1 parent bdb9106 commit 10c06b3Copy full SHA for 10c06b3
src/transformers/cache_utils.py
@@ -9,7 +9,6 @@
9
from .configuration_utils import PretrainedConfig
10
from .utils import is_hqq_available, is_quanto_available, logging
11
12
-
13
if is_quanto_available():
14
from quanto import QBitsTensor, qint2, qint4
15
@@ -792,8 +791,8 @@ def update(
792
791
k_out = self.key_cache[layer_idx]
793
v_out = self.value_cache[layer_idx]
794
795
- k_out[:, :, cache_position] = key_states
796
- v_out[:, :, cache_position] = value_states
+ k_out.index_copy_(2, cache_position, key_states)
+ v_out.index_copy_(2, cache_position, value_states)
797
798
return k_out, v_out
799
0 commit comments