Skip to content

Commit c9cb73c

Browse files
committed
chore: change to call llama_grammar_sample and llama_grammar_accept_token functions instead of deprecated functions
1 parent 9688c03 commit c9cb73c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/llama_cpp/llama_cpp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3378,7 +3378,7 @@ class RbLLaMAContext {
33783378
}
33793379
LLaMAGrammarWrapper* grm_ptr = RbLLaMAGrammar::get_llama_grammar(kw_values[0]);
33803380

3381-
llama_sample_grammar(ctx_ptr->ctx, &(cnd_ptr->array), grm_ptr->grammar);
3381+
llama_grammar_sample(grm_ptr->grammar, ctx_ptr->ctx, &(cnd_ptr->array));
33823382

33833383
return Qnil;
33843384
}
@@ -3407,7 +3407,7 @@ class RbLLaMAContext {
34073407
LLaMAGrammarWrapper* grm_ptr = RbLLaMAGrammar::get_llama_grammar(kw_values[0]);
34083408
llama_token token = NUM2INT(kw_values[1]);
34093409

3410-
llama_grammar_accept_token(ctx_ptr->ctx, grm_ptr->grammar, token);
3410+
llama_grammar_accept_token(grm_ptr->grammar, ctx_ptr->ctx, token);
34113411

34123412
return Qnil;
34133413
}

0 commit comments

Comments
 (0)