File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed 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__(
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 ))
You can’t perform that action at this time.
0 commit comments