| 325 | } |
| 326 | |
| 327 | void common_perf_print(const struct llama_context * ctx, const struct common_sampler * gsmpl) { |
| 328 | // TODO: measure grammar performance |
| 329 | |
| 330 | if (gsmpl) { |
| 331 | llama_perf_sampler_print(gsmpl->chain); |
| 332 | } |
| 333 | if (ctx) { |
| 334 | llama_perf_context_print(ctx); |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | llama_token common_sampler_sample(struct common_sampler * gsmpl, struct llama_context * ctx, int idx, bool grammar_first) { |
| 339 | gsmpl->set_logits(ctx, idx); |