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 @@ -487,9 +487,9 @@ def _sample(
487
487
nl_logit = logits [self ._token_nl ]
488
488
candidates = self ._candidates
489
489
candidates_data = self ._candidates_data
490
- candidates_data ["id" ] = np .arange (n_vocab , dtype = np .intc ) # type: ignore
491
- candidates_data ["logit" ] = logits
492
- candidates_data ["p" ] = np .zeros (n_vocab , dtype = np .single )
490
+ candidates_data ["id" ][:] = np .arange (n_vocab , dtype = np .intc ) # type: ignore
491
+ candidates_data ["logit" ][:] = logits
492
+ candidates_data ["p" ][:] = np .zeros (n_vocab , dtype = np .single )
493
493
candidates .data = candidates_data .ctypes .data_as (llama_cpp .llama_token_data_p )
494
494
candidates .sorted = llama_cpp .c_bool (False )
495
495
candidates .size = llama_cpp .c_size_t (n_vocab )
You can’t perform that action at this time.
0 commit comments