Skip to content

Commit ab27956

Browse files
committed
Add seqrep API docs since "himom" probably falls a bit short
1 parent b8623fc commit ab27956

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llama.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,11 @@ extern "C" {
407407
/// @details Frequency and presence penalties described in OpenAI API https://platform.openai.com/docs/api-reference/parameter-details.
408408
LLAMA_API void llama_sample_frequency_and_presence_penalties(struct llama_context * ctx, llama_token_data_array * candidates, const llama_token * last_tokens, size_t last_tokens_size, float alpha_frequency, float alpha_presence);
409409

410-
/// @details himom
410+
/// @details Sequence repetition penalty with semi-fuzzy matching.
411+
/// @params min_length The minimum length of a matching sequence of tokens.
412+
/// @params tolerance Tolerance for non-matching tokens in a sequence.
413+
/// @params flat_penalty Flat penalty applied to the token that can continue a repeated sequence.
414+
/// @params stacking_penalty Scaling penalty applied to the token that can continue a repeated sequence. The penalty is multiplied by the total length of sequences that are continued by this token.
411415
LLAMA_API void llama_sample_seqrep_penalty(struct llama_context * ctx, llama_token_data_array * candidates, const llama_token * last_tokens_p, size_t last_tokens_size, size_t min_length, size_t tolerance, float flat_penalty, float length_penalty);
412416

413417
/// @details Apply classifier-free guidance to the logits as described in academic paper "Stay on topic with Classifier-Free Guidance" https://arxiv.org/abs/2306.17806

0 commit comments

Comments
 (0)