diff --git a/vllm/utils.py b/vllm/utils.py index c4c74a37..c6e2afff 100644 --- a/vllm/utils.py +++ b/vllm/utils.py @@ -316,7 +316,10 @@ class LRUCache(cachetools.LRUCache[_K, _V], Generic[_K, _V]): return info def touch(self, key: _K) -> None: - self._LRUCache__update(key) # type: ignore + try: + self._LRUCache__order.move_to_end(key) # type: ignore + except KeyError: + self._LRUCache__order[key] = None # type: ignore @overload def get(self, key: _K, /) -> Optional[_V]: