pub struct Florence2TextConfig {Show 18 fields
pub vocab_size: usize,
pub d_model: usize,
pub encoder_layers: usize,
pub decoder_layers: usize,
pub encoder_attention_heads: usize,
pub decoder_attention_heads: usize,
pub encoder_ffn_dim: usize,
pub decoder_ffn_dim: usize,
pub max_position_embeddings: usize,
pub scale_embedding: bool,
pub bos_token_id: u32,
pub eos_token_id: u32,
pub pad_token_id: u32,
pub decoder_start_token_id: u32,
pub forced_bos_token_id: u32,
pub forced_eos_token_id: u32,
pub num_beams: usize,
pub no_repeat_ngram_size: usize,
}Expand description
BART text model configuration (text_config).
Fields§
§vocab_size: usize§d_model: usize§encoder_layers: usize§decoder_layers: usize§encoder_attention_heads: usize§decoder_attention_heads: usize§encoder_ffn_dim: usize§decoder_ffn_dim: usize§max_position_embeddings: usize§scale_embedding: bool§bos_token_id: u32§eos_token_id: u32§pad_token_id: u32§decoder_start_token_id: u32§forced_bos_token_id: u32§forced_eos_token_id: u32§num_beams: usize§no_repeat_ngram_size: usizeImplementations§
Source§impl Florence2TextConfig
impl Florence2TextConfig
Sourcepub const POS_OFFSET: usize = 2
pub const POS_OFFSET: usize = 2
Learned positional embeddings carry an offset of 2 (BART hack).
pub fn enc_head_dim(&self) -> usize
pub fn dec_head_dim(&self) -> usize
Trait Implementations§
Source§impl Clone for Florence2TextConfig
impl Clone for Florence2TextConfig
Source§fn clone(&self) -> Florence2TextConfig
fn clone(&self) -> Florence2TextConfig
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 moreAuto Trait Implementations§
impl Freeze for Florence2TextConfig
impl RefUnwindSafe for Florence2TextConfig
impl Send for Florence2TextConfig
impl Sync for Florence2TextConfig
impl Unpin for Florence2TextConfig
impl UnsafeUnpin for Florence2TextConfig
impl UnwindSafe for Florence2TextConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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