llama_sample_repetition_penalties method

void llama_sample_repetition_penalties(
  1. Pointer<llama_context> ctx,
  2. Pointer<llama_token_data_array> candidates,
  3. Pointer<llama_token> last_tokens,
  4. int penalty_last_n,
  5. double penalty_repeat,
  6. double penalty_freq,
  7. 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,
  );
}