llama_sample_repetition_penalties method
void
llama_sample_repetition_penalties(
- Pointer<
llama_context> ctx, - Pointer<
llama_token_data_array> candidates, - Pointer<
llama_token> last_tokens, - int penalty_last_n,
- double penalty_repeat,
- double penalty_freq,
- double penalty_present,
@details Repetition penalty described in CTRL academic paper https://arxiv.org/abs/1909.05858, with negative logit fix. @details Frequency and presence penalties described in OpenAI API https://platform.openai.com/docs/api-reference/parameter-details.
Implementation
void llama_sample_repetition_penalties(
ffi.Pointer<llama_context> ctx,
ffi.Pointer<llama_token_data_array> candidates,
ffi.Pointer<llama_token> last_tokens,
int penalty_last_n,
double penalty_repeat,
double penalty_freq,
double penalty_present,
) {
return _llama_sample_repetition_penalties(
ctx,
candidates,
last_tokens,
penalty_last_n,
penalty_repeat,
penalty_freq,
penalty_present,
);
}