Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b4a3db3

Browse filesBrowse files
committed
Update type signature
1 parent 04d9218 commit b4a3db3
Copy full SHA for b4a3db3

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎llama_cpp/llama.py

Copy file name to clipboardExpand all lines: llama_cpp/llama.py
+2-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.