| 348 | } |
| 349 | |
| 350 | void common_sampler_free(struct common_sampler * gsmpl) { |
| 351 | if (!gsmpl) { |
| 352 | return; |
| 353 | } |
| 354 | |
| 355 | llama_sampler_free(gsmpl->grmr); |
| 356 | llama_sampler_free(gsmpl->chain); |
| 357 | |
| 358 | delete gsmpl; |
| 359 | } |
| 360 | |
| 361 | void common_sampler_accept(struct common_sampler * gsmpl, llama_token token, bool accept_grammar) { |
| 362 | if (!gsmpl) { |