| 298 | } |
| 299 | |
| 300 | void common_sampler_accept(struct common_sampler * gsmpl, llama_token token, bool accept_grammar) { |
| 301 | if (accept_grammar) { |
| 302 | llama_sampler_accept(gsmpl->grmr, token); |
| 303 | } |
| 304 | |
| 305 | llama_sampler_accept(gsmpl->chain, token); |
| 306 | |
| 307 | gsmpl->prev.push_back(token); |
| 308 | } |
| 309 | |
| 310 | void common_sampler_reset(struct common_sampler * gsmpl) { |
| 311 | llama_sampler_reset(gsmpl->grmr); |