pub struct EncoderSpec {
pub ffn: BertFfn,
pub topology: BertTopology,
pub rope_interleaved: bool,
pub final_norm_name: &'static str,
}Expand description
The architectures this loader builds, with the FFN each one runs.
Both share bert.cpp’s graph; what differs is two lines of it,
and both are read from the architecture because upstream reads
them that way: the rotation at :126-133 and the FFN at
:179-201. A row here is a promise that every OTHER line of that
graph is the same, which is why nomic-bert-moe is not in it (its
moe_every_n_layers layers are a second FFN shape) and
jina-bert-v2 is not either (a second attention norm).
One architecture’s row on this loader: the FFN, where the norms
sit, and which rotation (if any) the attention uses.
Fields§
§ffn: BertFfn§topology: BertTopology§rope_interleaved: booltrue for the NORM (interleaved) rotation: llama_model_rope_type
answers that for neo-bert and NEOX for the others.
final_norm_name: &'static strThe tensor the FINAL norm is stored under, for the pre-norm
shape. neo-bert.cpp:23 uses enc.output_norm and
eurobert.cpp:16 plain output_norm – one fact, two
spellings, which is the attn_output_norm case again.
Trait Implementations§
Source§impl Clone for EncoderSpec
impl Clone for EncoderSpec
impl Copy for EncoderSpec
Source§impl Debug for EncoderSpec
impl Debug for EncoderSpec
impl Eq for EncoderSpec
Source§impl PartialEq for EncoderSpec
impl PartialEq for EncoderSpec
impl StructuralPartialEq for EncoderSpec
Auto Trait Implementations§
impl Freeze for EncoderSpec
impl RefUnwindSafe for EncoderSpec
impl Send for EncoderSpec
impl Sync for EncoderSpec
impl Unpin for EncoderSpec
impl UnsafeUnpin for EncoderSpec
impl UnwindSafe for EncoderSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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