pub struct AddedTokenConfig {
pub id: u32,
pub content: String,
pub single_word: bool,
pub lstrip: bool,
pub rstrip: bool,
pub normalized: bool,
pub special: bool,
}Expand description
An entry in the added_tokens array of tokenizer.json.
Fields§
§id: u32Token ID.
content: StringLiteral text content that triggers this token.
single_word: boolWhether the token should only match as a whole word.
lstrip: boolWhether to strip whitespace on the left when matching.
rstrip: boolWhether to strip whitespace on the right when matching.
normalized: boolWhether the content should be matched against normalized text.
special: boolWhether this is a “special” token (e.g. BOS/EOS). All added tokens are matched regardless of this flag; it only affects post-processing.
Trait Implementations§
Source§impl Clone for AddedTokenConfig
impl Clone for AddedTokenConfig
Source§fn clone(&self) -> AddedTokenConfig
fn clone(&self) -> AddedTokenConfig
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 moreSource§impl Debug for AddedTokenConfig
impl Debug for AddedTokenConfig
Source§impl<'de> Deserialize<'de> for AddedTokenConfig
impl<'de> Deserialize<'de> for AddedTokenConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AddedTokenConfig
impl RefUnwindSafe for AddedTokenConfig
impl Send for AddedTokenConfig
impl Sync for AddedTokenConfig
impl Unpin for AddedTokenConfig
impl UnsafeUnpin for AddedTokenConfig
impl UnwindSafe for AddedTokenConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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