(self, tokens: Sequence[int])
| 12552 | self._evict_until(int(self.max_bytes * 0.9)) |
| 12553 | |
| 12554 | def lookup(self, tokens: Sequence[int]) -> Optional[SequenceCache.Match]: |
| 12555 | if not tokens: |
| 12556 | return None |
| 12557 | entry_id, _ = self._trie.longest_prefix(tokens) |
| 12558 | entry = self._entries_by_id.get(entry_id) |
| 12559 | if entry is None: |
| 12560 | return None |
| 12561 | self._touch(entry) |
| 12562 | return SequenceCache.Match( |
| 12563 | tokens=entry.tokens, |
| 12564 | has_prompt_logits=entry.has_prompt_logits, |
| 12565 | ) |
| 12566 | |
| 12567 | def load( |
| 12568 | self, |
nothing calls this directly
no test coverage detected