(self, key: Sequence[int], value: "llama_cpp.llama.LlamaState")
| 89 | return self._find_longest_prefix_key(tuple(key)) is not None |
| 90 | |
| 91 | def __setitem__(self, key: Sequence[int], value: "llama_cpp.llama.LlamaState"): |
| 92 | key = tuple(key) |
| 93 | if key in self.cache_state: |
| 94 | del self.cache_state[key] |
| 95 | self.cache_state[key] = value |
| 96 | while self.cache_size > self.capacity_bytes and len(self.cache_state) > 0: |
| 97 | self.cache_state.popitem(last=False) |
| 98 | |
| 99 | |
| 100 | # Alias for backwards compatibility |
nothing calls this directly
no outgoing calls
no test coverage detected