File tree Expand file tree <
8000
button data-component="IconButton" type="button" data-testid="collapse-file-tree-button" aria-expanded="true" aria-controls="diff_file_tree" class="prc-Button-ButtonBase-c50BI d-none d-md-flex position-relative fgColor-muted prc-Button-IconButton-szpyj" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="invisible" aria-describedby=":Rsatdab:-loading-announcement" aria-labelledby=":R4atdab:">
Collapse file tree 1 file changed +3
-3
lines changed 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