llm_chain_llama_sys

Function llama_sample_repetition_penalty

Source
pub unsafe extern "C" fn llama_sample_repetition_penalty(
    ctx: *mut llama_context,
    candidates: *mut llama_token_data_array,
    last_tokens: *const llama_token,
    last_tokens_size: usize,
    penalty: f32,
)
Expand description

@details Repetition penalty described in CTRL academic paper https://arxiv.org/abs/1909.05858, with negative logit fix.