Commit ffd0079 1 parent 04ce3a8 commit ffd0079 Copy full SHA for ffd0079
File tree 1 file changed +3
-2
lines changed
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(
282
282
GGML_ASSERT (!original_logits.empty ());
283
283
}
284
284
llama_token id = 0 ;
285
- // Get a pointer to the logits
286
- float * logits = llama_get_logits_ith (ctx_main, idx);
287
285
288
286
if (temp < 0.0 ) {
289
287
// greedy sampling, with probs
@@ -324,6 +322,9 @@ static llama_token llama_sampling_sample_impl(
324
322
}
325
323
326
324
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
+
327
328
// Create an array with a single token data element for the sampled id
328
329
llama_token_data single_token_data = {id, logits[id], 0 .0f };
329
330
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