| 8372 | } |
| 8373 | |
| 8374 | void llama_sample_temp(struct llama_context * ctx, llama_token_data_array * candidates_p, float temp) { |
| 8375 | const int64_t t_start_sample_us = ggml_time_us(); |
| 8376 | |
| 8377 | for (size_t i = 0; i < candidates_p->size; ++i) { |
| 8378 | candidates_p->data[i].logit /= temp; |
| 8379 | } |
| 8380 | |
| 8381 | if (ctx) { |
| 8382 | ctx->t_sample_us += ggml_time_us() - t_start_sample_us; |
| 8383 | } |
| 8384 | } |
| 8385 | |
| 8386 | void llama_sample_temperature(struct llama_context * ctx, llama_token_data_array * candidates_p, float temp) { |
| 8387 | llama_sample_temp(ctx, candidates_p, temp); |
no test coverage detected