pub struct LocalMeasurer { /* private fields */ }Expand description
Adapter that implements Measurer over the registry.
Implementations§
Source§impl LocalMeasurer
impl LocalMeasurer
Sourcepub fn new(registry: TokenizerRegistry) -> Self
pub fn new(registry: TokenizerRegistry) -> Self
Build from an explicit registry.
Sourcepub fn with_defaults() -> Result<Self, TokenizerError>
pub fn with_defaults() -> Result<Self, TokenizerError>
Sourcepub fn cross_tokenize(&self, text: &str) -> Vec<(String, u32)>
pub fn cross_tokenize(&self, text: &str) -> Vec<(String, u32)>
Tokenize the given text against EVERY registered tokenizer
rather than the model-specific one. Returns (name, count)
tuples in stable order so cross-tokenizer audit rows replay.
This is the telemetry that powers tokenizer-resilient closed-loop tuning: when an upstream provider ships a new tokenizer, the per-tokenizer savings stop matching the model-specific savings and the auto-tuner sees the drift before users do.
Trait Implementations§
Source§impl Clone for LocalMeasurer
impl Clone for LocalMeasurer
Source§fn clone(&self) -> LocalMeasurer
fn clone(&self) -> LocalMeasurer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Measurer for LocalMeasurer
impl Measurer for LocalMeasurer
Auto Trait Implementations§
impl Freeze for LocalMeasurer
impl RefUnwindSafe for LocalMeasurer
impl Send for LocalMeasurer
impl Sync for LocalMeasurer
impl Unpin for LocalMeasurer
impl UnsafeUnpin for LocalMeasurer
impl UnwindSafe for LocalMeasurer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more