pub struct ByteTokenizer { /* private fields */ }Implementations§
Source§impl ByteTokenizer
impl ByteTokenizer
Sourcepub fn with_config(config: &TrainingConfig) -> Result<Self>
pub fn with_config(config: &TrainingConfig) -> Result<Self>
A ready byte tokenizer for config; no corpus needed.
Trait Implementations§
Source§impl Default for ByteTokenizer
impl Default for ByteTokenizer
Source§impl Tokenizer for ByteTokenizer
impl Tokenizer for ByteTokenizer
Source§fn train(
&mut self,
corpus: &mut dyn CorpusSource,
config: &TrainingConfig,
) -> Result<Vocabulary>
fn train( &mut self, corpus: &mut dyn CorpusSource, config: &TrainingConfig, ) -> Result<Vocabulary>
Learn a vocabulary from
corpus, install it, and return a copy.Source§fn load(&mut self, vocabulary: Vocabulary) -> Result<()>
fn load(&mut self, vocabulary: Vocabulary) -> Result<()>
Install a vocabulary produced earlier. Implementations validate it.
fn encode(&self, input: &CanonicalInput) -> Result<TokenSequence>
fn decode(&self, tokens: &TokenSequence) -> Result<CanonicalInput>
fn vocabulary(&self) -> Option<&Vocabulary>
fn capabilities(&self) -> TokenizerCapabilities
Auto Trait Implementations§
impl Forget for ByteTokenizer
impl Freeze for ByteTokenizer
impl Move for ByteTokenizer
impl RefUnwindSafe for ByteTokenizer
impl Send for ByteTokenizer
impl Sync for ByteTokenizer
impl Unpin for ByteTokenizer
impl UnsafeUnpin for ByteTokenizer
impl UnwindSafe for ByteTokenizer
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