pub struct MtpSessionConfig {
pub n_seq: u32,
pub n_draft_max: i32,
pub n_min: i32,
pub p_min: f32,
}Expand description
Parameters for MtpSession::new_with_config.
Maps directly to upstream common_params_speculative_draft.
§Examples
ⓘ
// Defaults: n_min = 0, p_min = 0.0 (aligned with upstream #23269+)
let cfg = MtpSessionConfig::new(1, 3);
// Stricter drafts: skip tokens below 10% draft-model probability
let cfg = MtpSessionConfig::new(1, 1).with_p_min(0.10);Fields§
§n_seq: u32Number of concurrent sequences (usually 1).
n_draft_max: i32Maximum tokens drafted per MtpSession::draft call (n_max upstream).
n_min: i32Minimum draft tokens to propose (n_min upstream, default 0).
p_min: f32Greedy probability floor; drafts below this are dropped (p_min upstream, default 0.0).
Implementations§
Source§impl MtpSessionConfig
impl MtpSessionConfig
Sourcepub fn with_n_min(self, n_min: i32) -> Self
pub fn with_n_min(self, n_min: i32) -> Self
Set minimum draft tokens (n_min upstream).
Sourcepub fn with_p_min(self, p_min: f32) -> Self
pub fn with_p_min(self, p_min: f32) -> Self
Trait Implementations§
Source§impl Clone for MtpSessionConfig
impl Clone for MtpSessionConfig
Source§fn clone(&self) -> MtpSessionConfig
fn clone(&self) -> MtpSessionConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MtpSessionConfig
Source§impl Debug for MtpSessionConfig
impl Debug for MtpSessionConfig
Source§impl PartialEq for MtpSessionConfig
impl PartialEq for MtpSessionConfig
Source§fn eq(&self, other: &MtpSessionConfig) -> bool
fn eq(&self, other: &MtpSessionConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MtpSessionConfig
Auto Trait Implementations§
impl Freeze for MtpSessionConfig
impl RefUnwindSafe for MtpSessionConfig
impl Send for MtpSessionConfig
impl Sync for MtpSessionConfig
impl Unpin for MtpSessionConfig
impl UnsafeUnpin for MtpSessionConfig
impl UnwindSafe for MtpSessionConfig
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