File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Original file line number Diff line number Diff line change @@ -405,6 +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
409
for i in range (0 , len (tokens ), self .n_batch ):
409
410
batch = tokens [i : min (len (tokens ), i + self .n_batch )]
410
411
n_past = min (n_ctx - len (batch ), len (self ._input_ids ))
@@ -430,9 +431,8 @@ def eval(self, tokens: Sequence[int]):
430
431
logits_view = llama_cpp .llama_get_logits (self .ctx )
431
432
logits = [logits_view [i * cols : (i + 1 ) * cols ] for i in range (rows )]
432
433
self .eval_logits .extend (logits )
433
- self ._scores : npt .NDArray [np .single ] = np .concatenate (
434
- (self ._scores , np .array (logits , dtype = np .single )), axis = 0
435
- )
434
+ scores .append (np .array (logits , dtype = np .single ))
435
+ self ._scores = np .concatenate (scores )
436
436
437
437
def _sample (
438
438
self ,
You can’t perform that action at this time.
0 commit comments