pub struct LightweightFilter { /* private fields */ }Expand description
SafetyMode::Lightweight — a training-free blacklist filter (real). Banned
tokens receive a very large negative logit so they cannot be sampled.
Implementations§
Trait Implementations§
Source§impl SafetySteerer for LightweightFilter
impl SafetySteerer for LightweightFilter
fn adjust(&self, _recent: &[u32]) -> LogitAdjustment
fn mode(&self) -> SafetyMode
Source§fn adjust_with_logits(
&self,
recent_tokens: &[u32],
_base_logits: &[i32],
) -> LogitAdjustment
fn adjust_with_logits( &self, recent_tokens: &[u32], _base_logits: &[i32], ) -> LogitAdjustment
Logit-aware steering (ADR-013). Given the base model’s next-token logits
for this step, return the adjustment to apply (still after the grammar
mask, before sampling — the ADR-005 order is unchanged). Read more
Auto Trait Implementations§
impl Freeze for LightweightFilter
impl RefUnwindSafe for LightweightFilter
impl Send for LightweightFilter
impl Sync for LightweightFilter
impl Unpin for LightweightFilter
impl UnsafeUnpin for LightweightFilter
impl UnwindSafe for LightweightFilter
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