use crate::LLAMA_DEFAULT_SEED;
pub const COMMON_SAMPLER_TYPE_NONE: common_sampler_type = 0;
pub const COMMON_SAMPLER_TYPE_DRY: common_sampler_type = 1;
pub const COMMON_SAMPLER_TYPE_TOP_K: common_sampler_type = 2;
pub const COMMON_SAMPLER_TYPE_TOP_P: common_sampler_type = 3;
pub const COMMON_SAMPLER_TYPE_MIN_P: common_sampler_type = 4;
pub const COMMON_SAMPLER_TYPE_TYPICAL_P: common_sampler_type = 6;
pub const COMMON_SAMPLER_TYPE_TEMPERATURE: common_sampler_type = 7;
pub const COMMON_SAMPLER_TYPE_XTC: common_sampler_type = 8;
pub const COMMON_SAMPLER_TYPE_INFILL: common_sampler_type = 9;
pub const COMMON_SAMPLER_TYPE_PENALTIES: common_sampler_type = 10;
pub const COMMON_SAMPLER_TYPE_TOP_N_SIGMA: common_sampler_type = 11;
pub const COMMON_SAMPLER_TYPE_ADAPTIVE_P: common_sampler_type = 12;
pub type common_sampler_type = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, PartialEq)]
pub struct common_sampler_params {
pub seed: u32,
pub n_prev: i32,
pub n_probs: i32,
pub min_keep: i32,
pub top_k: i32,
pub top_p: f32,
pub min_p: f32,
pub xtc_probability: f32,
pub xtc_threshold: f32,
pub typ_p: f32,
pub temp: f32,
pub dynatemp_range: f32,
pub dynatemp_exponent: f32,
pub penalty_last_n: i32,
pub penalty_repeat: f32,
pub penalty_freq: f32,
pub penalty_present: f32,
pub dry_multiplier: f32,
pub dry_base: f32,
pub dry_allowed_length: i32,
pub dry_penalty_last_n: i32,
pub adaptive_target: f32,
pub adaptive_decay: f32,
pub mirostat: i32,
pub top_n_sigma: f32,
pub mirostat_tau: f32,
pub mirostat_eta: f32,
pub ignore_eos: bool,
pub no_perf: bool,
pub timing_per_token: bool,
pub dry_sequence_breakers: Vec<String>,
pub samplers: Vec<common_sampler_type>,
pub grammar: Vec<String>,
pub logit_bias: Vec<(i32, f64)>,
}
impl Default for common_sampler_params {
fn default() -> Self {
Self {
seed: LLAMA_DEFAULT_SEED, n_prev: 64, n_probs: 0, min_keep: 0, top_k: 40, top_p: 0.95, min_p: 0.05, xtc_probability: 0.00, xtc_threshold: 0.10, typ_p: 1.00, temp: 0.80, dynatemp_range: 0.00, dynatemp_exponent: 1.00, penalty_last_n: 64, penalty_repeat: 1.00, penalty_freq: 0.00, penalty_present: 0.00, dry_multiplier: 0.0, dry_base: 1.75, dry_allowed_length: 2, dry_penalty_last_n: 64, adaptive_target: -1.0, adaptive_decay: 0.90, mirostat: 0, top_n_sigma: -1.00, mirostat_tau: 5.00, mirostat_eta: 0.10, ignore_eos: false,
no_perf: false, timing_per_token: false,
dry_sequence_breakers: vec!["\n".into(), ":".into(), "\"".into(), "*".into()],
samplers: vec![
COMMON_SAMPLER_TYPE_PENALTIES,
COMMON_SAMPLER_TYPE_DRY,
COMMON_SAMPLER_TYPE_TOP_N_SIGMA,
COMMON_SAMPLER_TYPE_TOP_K,
COMMON_SAMPLER_TYPE_TYPICAL_P,
COMMON_SAMPLER_TYPE_TOP_P,
COMMON_SAMPLER_TYPE_MIN_P,
COMMON_SAMPLER_TYPE_XTC,
COMMON_SAMPLER_TYPE_TEMPERATURE,
],
grammar: vec![],
logit_bias: vec![], }
}
}