pub enum TranslationOption {
Marian(MarianGenerator),
T5(T5Generator),
MBart(MBartGenerator),
M2M100(M2M100Generator),
NLLB(NLLBGenerator),
}Expand description
§Abstraction that holds one particular translation model, for any of the supported models
Variants§
Marian(MarianGenerator)
Translator based on Marian model
T5(T5Generator)
Translator based on T5 model
MBart(MBartGenerator)
Translator based on MBart50 model
M2M100(M2M100Generator)
Translator based on M2M100 model
NLLB(NLLBGenerator)
Translator based on NLLB model
Implementations§
Source§impl TranslationOption
impl TranslationOption
pub fn new(config: TranslationConfig) -> Result<Self, RustBertError>
pub fn new_with_tokenizer( config: TranslationConfig, tokenizer: TokenizerOption, ) -> Result<Self, RustBertError>
Sourcepub fn model_type(&self) -> ModelType
pub fn model_type(&self) -> ModelType
Returns the ModelType for this TranslationOption
Sourcepub fn get_tokenizer(&self) -> &TokenizerOption
pub fn get_tokenizer(&self) -> &TokenizerOption
Returns the Tokenizer for this TranslationOption
Sourcepub fn get_tokenizer_mut(&mut self) -> &mut TokenizerOption
pub fn get_tokenizer_mut(&mut self) -> &mut TokenizerOption
Interface method to access tokenizer
Auto Trait Implementations§
impl !Freeze for TranslationOption
impl !RefUnwindSafe for TranslationOption
impl Send for TranslationOption
impl !Sync for TranslationOption
impl Unpin for TranslationOption
impl !UnwindSafe for TranslationOption
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