pub enum ConfigOption {
Show 24 variants
Bart(BartConfig),
Bert(BertConfig),
DistilBert(DistilBertConfig),
Deberta(DebertaConfig),
DebertaV2(DebertaV2Config),
Electra(ElectraConfig),
Marian(MarianConfig),
MobileBert(MobileBertConfig),
OpenAiGpt(OpenAiGptConfig),
T5(T5Config),
LongT5(LongT5Config),
Albert(AlbertConfig),
XLNet(XLNetConfig),
GPT2(Gpt2Config),
GPTJ(GptJConfig),
Reformer(ReformerConfig),
Roberta(RobertaConfig),
ProphetNet(ProphetNetConfig),
Longformer(LongformerConfig),
Pegasus(PegasusConfig),
GPTNeo(GptNeoConfig),
MBart(MBartConfig),
M2M100(M2M100Config),
FNet(FNetConfig),
}
Expand description
§Abstraction that holds a model configuration, can be of any of the supported models
Variants§
Bart(BartConfig)
Bart configuration
Bert(BertConfig)
Bert configuration
DistilBert(DistilBertConfig)
DistilBert configuration
Deberta(DebertaConfig)
DeBERTa configuration
DebertaV2(DebertaV2Config)
DeBERTa V2 configuration
Electra(ElectraConfig)
Electra configuration
Marian(MarianConfig)
Marian configuration
MobileBert(MobileBertConfig)
MobileBert configuration
OpenAiGpt(OpenAiGptConfig)
OpenAI GPT configuration
T5(T5Config)
T5 configuration
LongT5(LongT5Config)
LongT5 configuration
Albert(AlbertConfig)
Albert configuration
XLNet(XLNetConfig)
XLNet configuration
GPT2(Gpt2Config)
GPT2 configuration
GPTJ(GptJConfig)
GPT-J configuration
Reformer(ReformerConfig)
Reformer configuration
Roberta(RobertaConfig)
RoBERTa configuration
ProphetNet(ProphetNetConfig)
ProphetNet configuration
Longformer(LongformerConfig)
Longformer configuration
Pegasus(PegasusConfig)
Pegasus configuration
GPTNeo(GptNeoConfig)
GPT-Neo configuration
MBart(MBartConfig)
MBart configuration
M2M100(M2M100Config)
M2M100 configuration
FNet(FNetConfig)
FNet configuration
Implementations§
Source§impl ConfigOption
impl ConfigOption
Sourcepub fn from_file<P: AsRef<Path>>(model_type: ModelType, path: P) -> Self
pub fn from_file<P: AsRef<Path>>(model_type: ModelType, path: P) -> Self
Interface method to load a configuration from file
pub fn get_label_mapping(&self) -> &HashMap<i64, String>
pub fn get_max_len(&self) -> Option<i64>
pub fn get_vocab_size(&self) -> i64
pub fn get_decoder_start_token_id(&self) -> Option<i64>
pub fn get_forced_bos_token_id(&self) -> Option<i64>
pub fn get_forced_eos_token_id(&self) -> Option<i64>
Trait Implementations§
Source§impl TryFrom<&ConfigOption> for AlbertConfig
impl TryFrom<&ConfigOption> for AlbertConfig
Source§type Error = RustBertError
type Error = RustBertError
The type returned in the event of a conversion error.
Source§impl TryFrom<&ConfigOption> for BertConfig
impl TryFrom<&ConfigOption> for BertConfig
Source§type Error = RustBertError
type Error = RustBertError
The type returned in the event of a conversion error.
Source§impl TryFrom<&ConfigOption> for DistilBertConfig
impl TryFrom<&ConfigOption> for DistilBertConfig
Source§type Error = RustBertError
type Error = RustBertError
The type returned in the event of a conversion error.
Source§impl TryFrom<&ConfigOption> for T5Config
impl TryFrom<&ConfigOption> for T5Config
Source§type Error = RustBertError
type Error = RustBertError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for ConfigOption
impl RefUnwindSafe for ConfigOption
impl Send for ConfigOption
impl Sync for ConfigOption
impl Unpin for ConfigOption
impl UnwindSafe for ConfigOption
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