pub struct ByteCeiling;Expand description
Counts a token per byte.
The only counter that is a genuine upper bound: byte-level BPE never emits more tokens than there are bytes, because merging is all it does. Far too conservative for ordinary use — it would spend a 400-token cap on 400 bytes — but it is the right answer when a cap must not be exceeded under any tokeniser at all.
Trait Implementations§
Source§impl Clone for ByteCeiling
impl Clone for ByteCeiling
impl Copy for ByteCeiling
Source§impl Debug for ByteCeiling
impl Debug for ByteCeiling
Source§impl Default for ByteCeiling
impl Default for ByteCeiling
impl Eq for ByteCeiling
Source§impl PartialEq for ByteCeiling
impl PartialEq for ByteCeiling
impl StructuralPartialEq for ByteCeiling
Source§impl TokenCount for ByteCeiling
impl TokenCount for ByteCeiling
Auto Trait Implementations§
impl Freeze for ByteCeiling
impl RefUnwindSafe for ByteCeiling
impl Send for ByteCeiling
impl Sync for ByteCeiling
impl Unpin for ByteCeiling
impl UnsafeUnpin for ByteCeiling
impl UnwindSafe for ByteCeiling
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