pub struct LlamaSampler {
pub backend: Arc<LlamaLib>,
pub handle: *mut llama_sampler,
}Fields§
§backend: Arc<LlamaLib>§handle: *mut llama_samplerImplementations§
Source§impl LlamaSampler
impl LlamaSampler
pub fn new_chain(backend: Arc<LlamaLib>, no_perf: bool) -> Self
pub fn new_greedy(backend: Arc<LlamaLib>) -> Self
pub fn new_temp(backend: Arc<LlamaLib>, temp: f32) -> Self
pub fn new_top_k(backend: Arc<LlamaLib>, k: i32) -> Self
pub fn new_top_p(backend: Arc<LlamaLib>, p: f32, min_keep: usize) -> Self
pub fn new_min_p(backend: Arc<LlamaLib>, p: f32, min_keep: usize) -> Self
pub fn new_typical(backend: Arc<LlamaLib>, p: f32, min_keep: usize) -> Self
pub fn new_mirostat_v2( backend: Arc<LlamaLib>, seed: u32, tau: f32, eta: f32, ) -> Self
pub fn new_penalties( backend: Arc<LlamaLib>, last_n: i32, repeat: f32, freq: f32, present: f32, ) -> Self
pub fn new_dist(backend: Arc<LlamaLib>, seed: u32) -> Self
pub fn add(&mut self, other: LlamaSampler)
pub fn sample(&self, ctx: &LlamaContext, idx: i32) -> llama_token
pub fn accept(&self, token: llama_token)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LlamaSampler
impl RefUnwindSafe for LlamaSampler
impl !Send for LlamaSampler
impl !Sync for LlamaSampler
impl Unpin for LlamaSampler
impl UnsafeUnpin for LlamaSampler
impl UnwindSafe for LlamaSampler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more