Skip to content

Commit c4dd629

Browse files
authored
Lint
1 parent 70a18f3 commit c4dd629

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llama_cpp/llama_cache.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import sys
22
from abc import ABC, abstractmethod
3+
from collections import OrderedDict
34
from typing import (
45
Optional,
56
Sequence,
67
Tuple,
78
)
8-
from collections import OrderedDict
99

1010
import diskcache
1111

@@ -52,7 +52,7 @@ class LlamaRAMCache(BaseLlamaCache):
5252
def __init__(self, capacity_bytes: int = (2 << 30)):
5353
super().__init__(capacity_bytes)
5454
self.capacity_bytes = capacity_bytes
55-
self.cache_state: OrderedDict[Tuple[int, ...], "llama_cpp.llama.LlamaState"] = (
55+
self.cache_state: OrderedDict[Tuple[int, ...], llama_cpp.llama.LlamaState] = (
5656
OrderedDict()
5757
)
5858

@@ -132,7 +132,7 @@ def __getitem__(self, key: Sequence[int]) -> "llama_cpp.llama.LlamaState":
132132
_key = self._find_longest_prefix_key(key)
133133
if _key is None:
134134
raise KeyError("Key not found")
135-
value: "llama_cpp.llama.LlamaState" = self.cache.pop(_key) # type: ignore
135+
value: llama_cpp.llama.LlamaState = self.cache.pop(_key) # type: ignore
136136
# NOTE: This puts an integer as key in cache, which breaks,
137137
# Llama.longest_token_prefix(k, key) above since k is not a tuple of ints/tokens
138138
# self.cache.push(_key, side="front") # type: ignore

0 commit comments

Comments
 (0)