pub struct XLMREncoder;Expand description
XLM-RoBERTa encoder (Conneau et al., 2019).
This is a simple convenience wrapper around
RobertaEncoder,
since RoBERTa and XLM-RoBERTa share the same architecture, only their tokenizers differ.
See Unsupervised Cross-lingual Representation Learning at Scale.
Trait Implementations§
Source§impl FromHF for XLMREncoder
impl FromHF for XLMREncoder
Source§type Config = TransformerEncoderConfig
type Config = TransformerEncoderConfig
Model configuration.
Source§type Model = TransformerEncoder
type Model = TransformerEncoder
The type of model that is constructed. Read more
Source§fn rename_parameters() -> impl Fn(&str) -> String
fn rename_parameters() -> impl Fn(&str) -> String
Create a parameter renaming function. Read more
Source§fn from_hf(
hf_config: HFConfigWithDType<Self::HFConfig>,
backend: Box<dyn SimpleBackend>,
device: &Device,
) -> Result<Self::Model, FromHFError>
fn from_hf( hf_config: HFConfigWithDType<Self::HFConfig>, backend: Box<dyn SimpleBackend>, device: &Device, ) -> Result<Self::Model, FromHFError>
Construct a model from an HF model configuration and parameter backend. Read more
Auto Trait Implementations§
impl Freeze for XLMREncoder
impl RefUnwindSafe for XLMREncoder
impl Send for XLMREncoder
impl Sync for XLMREncoder
impl Unpin for XLMREncoder
impl UnwindSafe for XLMREncoder
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> 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