#[repr(i32)]pub enum CommonSamplerType {
Dry = 1,
TopK = 2,
TopP = 3,
MinP = 4,
TypicalP = 6,
Temperature = 7,
Xtc = 8,
Infill = 9,
Penalties = 10,
TopNSigma = 11,
AdaptiveP = 12,
}Expand description
Which of llama.cpp’s samplers to run, and in what order.
Values match common_sampler_type; the default chain is penalties → DRY →
top-n-sigma → top-k → typical-p → top-p → min-p → XTC → temperature.
Variants§
Dry = 1
DRY repetition penalty.
TopK = 2
Top-k truncation.
TopP = 3
Top-p (nucleus) truncation.
MinP = 4
Min-p truncation.
TypicalP = 6
Typical-p truncation.
Temperature = 7
Temperature scaling.
Xtc = 8
Exclude Top Choices.
Infill = 9
Infill sampler, for fill-in-the-middle.
Penalties = 10
Repetition / frequency / presence penalties.
TopNSigma = 11
Top-n-sigma truncation.
AdaptiveP = 12
Adaptive-p, which targets a probability rather than a cutoff.
Implementations§
Source§impl CommonSamplerType
impl CommonSamplerType
Sourcepub fn name(self) -> Result<String, ShimError>
pub fn name(self) -> Result<String, ShimError>
llama.cpp’s own name for this sampler, e.g. "top_k".
§Errors
Returns CommonSamplerError::Failed if llama.cpp cannot name it.
Sourcepub fn from_names(names: &[&str]) -> Result<Vec<i32>, ShimError>
pub fn from_names(names: &[&str]) -> Result<Vec<i32>, ShimError>
Parse llama.cpp’s sampler names into an ordering.
Unrecognised names are dropped by llama.cpp rather than rejected, so a
shorter result than names means something was not understood.
§Errors
Returns CommonSamplerError::Nul if a name contains an interior NUL.
Trait Implementations§
Source§impl Clone for CommonSamplerType
impl Clone for CommonSamplerType
Source§fn clone(&self) -> CommonSamplerType
fn clone(&self) -> CommonSamplerType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more