pub struct ZeroCopyUtils;Expand description
Utilities for working with zero-copy tokenizers
Implementations§
Source§impl ZeroCopyUtils
impl ZeroCopyUtils
Sourcepub fn convert_tokenizer_to_zero_copy<T: Tokenizer, P: AsRef<Path>>(
tokenizer: &T,
path: P,
metadata: Option<&[u8]>,
special_tokens: Option<&[u8]>,
) -> Result<()>
pub fn convert_tokenizer_to_zero_copy<T: Tokenizer, P: AsRef<Path>>( tokenizer: &T, path: P, metadata: Option<&[u8]>, special_tokens: Option<&[u8]>, ) -> Result<()>
Convert a regular tokenizer to zero-copy format
Sourcepub fn validate_file<P: AsRef<Path>>(path: P) -> Result<bool>
pub fn validate_file<P: AsRef<Path>>(path: P) -> Result<bool>
Validate a zero-copy tokenizer file
Auto Trait Implementations§
impl Freeze for ZeroCopyUtils
impl RefUnwindSafe for ZeroCopyUtils
impl Send for ZeroCopyUtils
impl Sync for ZeroCopyUtils
impl Unpin for ZeroCopyUtils
impl UnsafeUnpin for ZeroCopyUtils
impl UnwindSafe for ZeroCopyUtils
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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