MCPcopy Create free account
hub / github.com/evilsocket/cake / process_kv

Method process_kv

cake-core/src/models/common/cache.rs:163–170  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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(

Callers 9

cache_process_kvFunction · 0.80
cache_clearFunction · 0.80
forwardMethod · 0.80
forwardMethod · 0.80
test_kv_cache_clearFunction · 0.80

Calls 1

process_kv_innerMethod · 0.80