#[non_exhaustive]pub enum TokenMethod {
Heuristic,
Bpe,
}Expand description
Token-count measurement methodology.
Used to make explicit which counting method produced a number, so that downstream reports cannot silently mix the fast heuristic with an accurate BPE tokenizer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Heuristic
Character-count heuristic (chars_per_token). Fast, dependency-free,
but self-referential when used to evaluate this crate’s own output:
it bakes in the same assumptions (e.g. PUA = 1 token) that the
compressor optimizes for, inflating the apparent reduction.
Bpe
Real BPE tokenizer (OpenAI cl100k_base via tiktoken-rs). Slower and
requires the tiktoken feature, but independent of this crate’s
compression assumptions — the honest basis for reduction claims.
Trait Implementations§
Source§impl Clone for TokenMethod
impl Clone for TokenMethod
Source§fn clone(&self) -> TokenMethod
fn clone(&self) -> TokenMethod
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 TokenMethod
Source§impl Debug for TokenMethod
impl Debug for TokenMethod
impl Eq for TokenMethod
Source§impl PartialEq for TokenMethod
impl PartialEq for TokenMethod
Source§fn eq(&self, other: &TokenMethod) -> bool
fn eq(&self, other: &TokenMethod) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TokenMethod
impl Serialize for TokenMethod
impl StructuralPartialEq for TokenMethod
Auto Trait Implementations§
impl Freeze for TokenMethod
impl RefUnwindSafe for TokenMethod
impl Send for TokenMethod
impl Sync for TokenMethod
impl Unpin for TokenMethod
impl UnsafeUnpin for TokenMethod
impl UnwindSafe for TokenMethod
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