pub enum SpecialTokens {
AsText,
Parse,
}Expand description
Whether a literal special-token marker in the input (<s>,
<|im_end|>, [SEP]) is carved out as the token it names or
tokenized as the characters it is written with.
llama.cpp’s parse_special. Callers choose per site, because the
right answer differs: a rendered chat prompt needs its template’s own
markers parsed, while a stop string, a DRY sequence breaker or a
rerank document is plain text whatever it happens to mention.
Variants§
AsText
parse_special = false, llama.cpp’s library default. CONTROL
and UNKNOWN entries are ordinary text; USER_DEFINED ones are
still carved out (llama-vocab.cpp:3169-3174).
Parse
parse_special = true: every special entry is matched as an
atomic substring before normal tokenization runs.
Trait Implementations§
Source§impl Clone for SpecialTokens
impl Clone for SpecialTokens
Source§fn clone(&self) -> SpecialTokens
fn clone(&self) -> SpecialTokens
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 SpecialTokens
Source§impl Debug for SpecialTokens
impl Debug for SpecialTokens
impl Eq for SpecialTokens
Source§impl PartialEq for SpecialTokens
impl PartialEq for SpecialTokens
impl StructuralPartialEq for SpecialTokens
Auto Trait Implementations§
impl Freeze for SpecialTokens
impl RefUnwindSafe for SpecialTokens
impl Send for SpecialTokens
impl Sync for SpecialTokens
impl Unpin for SpecialTokens
impl UnsafeUnpin for SpecialTokens
impl UnwindSafe for SpecialTokens
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