Process the input k and v by either generating their cache entry or applying a previously cached one.
(
&mut self,
block_idx: usize,
k: Tensor,
v: Tensor,
)
| 161 | |
| 162 | /// Process the input k and v by either generating their cache entry or applying a previously cached one. |
| 163 | pub fn process_kv( |
| 164 | &mut self, |
| 165 | block_idx: usize, |
| 166 | k: Tensor, |
| 167 | v: Tensor, |
| 168 | ) -> Result<(Tensor, Tensor)> { |
| 169 | self.process_kv_inner(block_idx, k, v, self.max_seq_len) |
| 170 | } |
| 171 | |
| 172 | /// Like `process_kv` but caps the KV cache to `window` tokens (sliding window attention). |
| 173 | pub fn process_kv_windowed( |