File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ def __init__(
325
325
self ._token_eos = Llama .token_eos ()
326
326
327
327
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 )
329
329
330
330
def tokenize (self , text : bytes , add_bos : bool = True ) -> List [int ]:
331
331
"""Tokenize a string.
@@ -405,7 +405,7 @@ def eval(self, tokens: Sequence[int]):
405
405
"""
406
406
assert self .ctx is not None
407
407
n_ctx = self ._n_ctx
408
- scores = []
408
+ scores : List [ npt . NDArray [ np . single ]] = []
409
409
for i in range (0 , len (tokens ), self .n_batch ):
410
410
batch = tokens [i : min (len (tokens ), i + self .n_batch )]
411
411
n_past = min (n_ctx - len (batch ), len (self ._input_ids ))
You can’t perform that action at this time.
0 commit comments