pub enum ModelConfig {
Bpe(Box<Bpe>),
WordPiece {
vocab: HashMap<String, u32>,
unk_token: String,
continuing_subword_prefix: String,
max_input_chars_per_word: Option<u64>,
},
WordLevel {
vocab: HashMap<String, u32>,
unk_token: String,
},
Unigram {
vocab: Vec<(String, f64)>,
unk_id: Option<u32>,
byte_fallback: bool,
},
Other(Value),
}Expand description
Tokenization model from tokenizer.json.
Variants§
Trait Implementations§
Source§impl Clone for ModelConfig
impl Clone for ModelConfig
Source§fn clone(&self) -> ModelConfig
fn clone(&self) -> ModelConfig
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 ModelConfig
impl Debug for ModelConfig
Source§impl<'de> Deserialize<'de> for ModelConfig
impl<'de> Deserialize<'de> for ModelConfig
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<'_enum> From<&'_enum ModelConfig> for ModelKind
impl<'_enum> From<&'_enum ModelConfig> for ModelKind
Source§fn from(val: &'_enum ModelConfig) -> ModelKind
fn from(val: &'_enum ModelConfig) -> ModelKind
Converts to this type from the input type.
Source§impl From<ModelConfig> for ModelKind
impl From<ModelConfig> for ModelKind
Source§fn from(val: ModelConfig) -> ModelKind
fn from(val: ModelConfig) -> ModelKind
Converts to this type from the input type.
Source§impl IntoDiscriminant for ModelConfig
impl IntoDiscriminant for ModelConfig
Source§type Discriminant = ModelKind
type Discriminant = ModelKind
Enum listing the same variants as this enum but without any data fields
fn discriminant(&self) -> Self::Discriminant
Auto Trait Implementations§
impl Freeze for ModelConfig
impl RefUnwindSafe for ModelConfig
impl Send for ModelConfig
impl Sync for ModelConfig
impl Unpin for ModelConfig
impl UnsafeUnpin for ModelConfig
impl UnwindSafe for ModelConfig
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