You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: include/llama.h
+9-5
Original file line number
Diff line number
Diff line change
@@ -965,6 +965,10 @@ extern "C" {
965
965
bool remove_special,
966
966
bool unparse_special);
967
967
968
+
//
969
+
// Chat templates
970
+
//
971
+
968
972
/// Apply chat template. Inspired by hf apply_chat_template() on python.
969
973
/// Both "model" and "custom_template" are optional, but at least one is required. "custom_template" has higher precedence than "model"
970
974
/// NOTE: This function does not use a jinja parser. It only support a pre-defined list of template. See more: https://github.com/ggerganov/llama.cpp/wiki/Templates-supported-by-llama_chat_apply_template
@@ -1005,19 +1009,19 @@ extern "C" {
1005
1009
1006
1010
/// @details Apply constraints from grammar
1007
1011
LLAMA_API voidllama_grammar_sample(
1008
-
structllama_context * ctx,
1009
-
llama_token_data_array * candidates,
1010
-
conststructllama_grammar * grammar);
1011
-
LLAMA_API DEPRECATED(boolllama_sample_grammar(
1012
+
conststructllama_grammar * grammar,
1013
+
conststructllama_context * ctx,
1014
+
llama_token_data_array * candidates);
1015
+
LLAMA_API DEPRECATED(voidllama_sample_grammar(
1012
1016
structllama_context * ctx,
1013
1017
llama_token_data_array * candidates,
1014
1018
conststructllama_grammar * grammar),
1015
1019
"use llama_grammar_sample instead");
1016
1020
1017
1021
/// @details Accepts the sampled token into the grammar
0 commit comments