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 @@ -407,6 +407,7 @@ def eval(self, tokens: Sequence[int]):
407
407
"""
408
408
assert self .ctx is not None
409
409
n_ctx = self ._n_ctx
410
+ scores = []
410
411
for i in range (0 , len (tokens ), self .n_batch ):
411
412
batch = tokens [i : min (len (tokens ), i + self .n_batch )]
412
413
n_past = min (n_ctx - len (batch ), len (self ._input_ids ))
@@ -432,9 +433,8 @@ def eval(self, tokens: Sequence[int]):
432
433
logits_view = llama_cpp .llama_get_logits (self .ctx )
433
434
logits = [logits_view [i * cols : (i + 1 ) * cols ] for i in range (rows )]
434
435
self .eval_logits .extend (logits )
435
- self ._scores : npt .NDArray [np .single ] = np .concatenate (
436
- (self ._scores , np .array (logits , dtype = np .single )), axis = 0
437
- )
436
+ scores .append (np .array (logits , dtype = np .single ))
437
+ self ._scores = np .concatenate (scores )
438
438
439
439
def _sample (
440
440
self ,
You can’t perform that action at this time.
0 commit comments