File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1044,13 +1044,26 @@ extern "C" {
1044
1044
llama_constraint_context_t ctx;
1045
1045
};
1046
1046
1047
+ // / @details Sorts candidate tokens by their logits in descending order and calculate probabilities based on logits.
1047
1048
LLAMA_API struct llama_constraint * llama_constraint_init_softmax (void );
1049
+
1050
+ // / @details Top-K sampling described in academic paper "The Curious Case of Neural Text Degeneration" https://arxiv.org/abs/1904.09751
1048
1051
LLAMA_API struct llama_constraint * llama_constraint_init_top_k (int32_t k);
1052
+
1053
+ // / @details Nucleus sampling described in academic paper "The Curious Case of Neural Text Degeneration" https://arxiv.org/abs/1904.09751
1049
1054
LLAMA_API struct llama_constraint * llama_constraint_init_top_p (float p, int32_t min_keep);
1055
+
1056
+ // / @details Minimum P sampling as described in https://github.com/ggerganov/llama.cpp/pull/3841
1050
1057
LLAMA_API struct llama_constraint * llama_constraint_init_min_p (float p, int32_t min_keep);
1058
+
1059
+ // / @details Tail Free Sampling described in https://www.trentonbricken.com/Tail-Free-Sampling/.
1051
1060
LLAMA_API struct llama_constraint * llama_constraint_init_tail_free (float z, int32_t min_keep);
1061
+
1062
+ // / @details Locally Typical Sampling implementation described in the paper https://arxiv.org/abs/2202.00666.
1052
1063
LLAMA_API struct llama_constraint * llama_constraint_init_typical (float p, int32_t min_keep);
1053
1064
LLAMA_API struct llama_constraint * llama_constraint_init_temp (float t);
1065
+
1066
+ // / @details Dynamic temperature implementation (a.k.a. entropy) described in the paper https://arxiv.org/abs/2309.02772.
1054
1067
LLAMA_API struct llama_constraint * llama_constraint_init_temp_ext (float t, float delta, float exponent);
1055
1068
1056
1069
// / @details Mirostat 1.0 algorithm described in the paper https://arxiv.org/abs/2007.14966. Uses tokens instead of words.
You can’t perform that action at this time.
0 commit comments