Skip to content

Commit b4a3db3

Browse files
committed
Update type signature
1 parent 04d9218 commit b4a3db3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llama_cpp/llama.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def __init__(
325325
self._token_eos = Llama.token_eos()
326326

327327
self._input_ids = np.array([], dtype=np.intc)
328-
self._scores = np.ndarray((0, self._n_vocab), dtype=np.single)
328+
self._scores: npt.NDArray[np.single] = np.ndarray((0, self._n_vocab), dtype=np.single)
329329

330330
def tokenize(self, text: bytes, add_bos: bool = True) -> List[int]:
331331
"""Tokenize a string.
@@ -405,7 +405,7 @@ def eval(self, tokens: Sequence[int]):
405405
"""
406406
assert self.ctx is not None
407407
n_ctx = self._n_ctx
408-
scores = []
408+
scores: List[npt.NDArray[np.single]] = []
409409
for i in range(0, len(tokens), self.n_batch):
410410
batch = tokens[i : min(len(tokens), i + self.n_batch)]
411411
n_past = min(n_ctx - len(batch), len(self._input_ids))

0 commit comments

Comments
 (0)