Enum tokenizers::models::ModelWrapper
source · pub enum ModelWrapper {
BPE(BPE),
WordPiece(WordPiece),
WordLevel(WordLevel),
Unigram(Unigram),
}
Variants§
Trait Implementations§
source§impl Clone for ModelWrapper
impl Clone for ModelWrapper
source§fn clone(&self) -> ModelWrapper
fn clone(&self) -> ModelWrapper
Returns a copy of the value. Read more
1.0.0 · 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 ModelWrapper
impl Debug for ModelWrapper
source§impl<'de> Deserialize<'de> for ModelWrapper
impl<'de> Deserialize<'de> for ModelWrapper
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
source§impl From<BPE> for ModelWrapper
impl From<BPE> for ModelWrapper
source§impl From<Unigram> for ModelWrapper
impl From<Unigram> for ModelWrapper
source§impl From<WordLevel> for ModelWrapper
impl From<WordLevel> for ModelWrapper
source§impl From<WordPiece> for ModelWrapper
impl From<WordPiece> for ModelWrapper
source§impl Model for ModelWrapper
impl Model for ModelWrapper
type Trainer = TrainerWrapper
source§fn tokenize(&self, tokens: &str) -> Result<Vec<Token>>
fn tokenize(&self, tokens: &str) -> Result<Vec<Token>>
Tokenize the given sequence into multiple underlying
Token
. The offsets
on the Token
are expected to be relative to the given sequence.source§fn get_vocab(&self) -> HashMap<String, u32>
fn get_vocab(&self) -> HashMap<String, u32>
Retrieve the entire vocabulary mapping (token -> ID)
source§fn get_vocab_size(&self) -> usize
fn get_vocab_size(&self) -> usize
Retrieve the size of the vocabulary
source§fn save(&self, folder: &Path, name: Option<&str>) -> Result<Vec<PathBuf>>
fn save(&self, folder: &Path, name: Option<&str>) -> Result<Vec<PathBuf>>
Save the current
Model
in the given folder, using the given prefix
for the various
files that need to be saved.source§fn get_trainer(&self) -> Self::Trainer
fn get_trainer(&self) -> Self::Trainer
Get an instance of a Trainer capable of training this Model
source§impl PartialEq for ModelWrapper
impl PartialEq for ModelWrapper
source§fn eq(&self, other: &ModelWrapper) -> bool
fn eq(&self, other: &ModelWrapper) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ModelWrapper
impl Serialize for ModelWrapper
impl StructuralPartialEq for ModelWrapper
Auto Trait Implementations§
impl !Freeze for ModelWrapper
impl RefUnwindSafe for ModelWrapper
impl Send for ModelWrapper
impl Sync for ModelWrapper
impl Unpin for ModelWrapper
impl UnwindSafe for ModelWrapper
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