llama_sampler_init_penalties function

  1. @Native<Pointer<llama_sampler> Function(Int32, Float, Float, Float)>(ffi.Int32, ffi.Float, ffi.Float, ffi.Float)>()
Pointer<llama_sampler> llama_sampler_init_penalties(
  1. int penalty_last_n,
  2. double penalty_repeat,
  3. double penalty_freq,
  4. double penalty_present,
)

NOTE: Avoid using on the full vocabulary as searching for repeated tokens can become slow. For example, apply top-k or top-p sampling first.

Implementation

@ffi.Native<
  ffi.Pointer<llama_sampler> Function(
    ffi.Int32,
    ffi.Float,
    ffi.Float,
    ffi.Float,
  )
>()
external ffi.Pointer<llama_sampler> llama_sampler_init_penalties(
  int penalty_last_n,
  double penalty_repeat,
  double penalty_freq,
  double penalty_present,
);