File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1262,6 +1262,21 @@ def llama_sample_token(
12621262_lib .llama_sample_token .restype = llama_token
12631263
12641264
1265+ # /// @details Accepts the sampled token into the grammar
1266+ # LLAMA_API void llama_grammar_accept_token(struct llama_context * ctx, struct llama_grammar * grammar, llama_token token);
1267+ def llama_grammar_accept_token (
1268+ ctx : llama_context_p , grammar : llama_grammar_p , token : llama_token
1269+ ):
1270+ return _lib .llama_grammar_accept_token (ctx , grammar , token )
1271+
1272+
1273+ _lib .llama_grammar_accept_token .argtypes = [
1274+ llama_context_p ,
1275+ llama_grammar_p ,
1276+ llama_token ,
1277+ ]
1278+ _lib .llama_grammar_accept_token .restype = None
1279+
12651280# Performance information
12661281
12671282
You can’t perform that action at this time.
0 commit comments