File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -282,8 +282,6 @@ static llama_token llama_sampling_sample_impl(
282282 GGML_ASSERT (!original_logits.empty ());
283283 }
284284 llama_token id = 0 ;
285- // Get a pointer to the logits
286- float * logits = llama_get_logits_ith (ctx_main, idx);
287285
288286 if (temp < 0.0 ) {
289287 // greedy sampling, with probs
@@ -324,6 +322,9 @@ static llama_token llama_sampling_sample_impl(
324322 }
325323
326324 if (ctx_sampling->grammar != NULL && !is_resampling) {
325+ // Get a pointer to the logits
326+ float * logits = llama_get_logits_ith (ctx_main, idx);
327+
327328 // Create an array with a single token data element for the sampled id
328329 llama_token_data single_token_data = {id, logits[id], 0 .0f };
329330 llama_token_data_array single_token_data_array = { &single_token_data, 1 , false };
You can’t perform that action at this time.
0 commit comments