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
LLAMA_API llama_token llama_token_prefix(conststructllama_model * model); // Beginning of infill prefix
@@ -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
/// @details Accepts the sampled token into the grammar
1022
+
LLAMA_API voidllama_grammar_accept_token(
1023
+
structllama_grammar * grammar,
1024
+
structllama_context * ctx,
1025
+
llama_token token);
1026
+
1006
1027
//
1007
1028
// Sampling functions
1008
1029
//
@@ -1084,12 +1105,6 @@ extern "C" {
1084
1105
llama_token_data_array * candidates,
1085
1106
float temp);
1086
1107
1087
-
/// @details Apply constraints from grammar
1088
-
LLAMA_API voidllama_sample_grammar(
1089
-
structllama_context * ctx,
1090
-
llama_token_data_array * candidates,
1091
-
conststructllama_grammar * grammar);
1092
-
1093
1108
/// @details Mirostat 1.0 algorithm described in the paper https://arxiv.org/abs/2007.14966. Uses tokens instead of words.
1094
1109
/// @param candidates A vector of `llama_token_data` containing the candidate tokens, their probabilities (p), and log-odds (logit) for the current position in the generated text.
1095
1110
/// @param tau The target cross-entropy (or surprise) value you want to achieve for the generated text. A higher value corresponds to more surprising or less predictable text, while a lower value corresponds to less surprising or more predictable text.
@@ -1127,12 +1142,6 @@ extern "C" {
1127
1142
structllama_context * ctx,
1128
1143
llama_token_data_array * candidates);
1129
1144
1130
-
/// @details Accepts the sampled token into the grammar
0 commit comments