#[non_exhaustive]pub struct ModelDescriptor {Show 19 fields
pub id: String,
pub family: Family,
pub dim: usize,
pub default_max_length: usize,
pub pooling: Pooling,
pub normalize: bool,
pub query_template: Option<String>,
pub passage_template: Option<String>,
pub default_instruction: Option<String>,
pub dense_dirs: Vec<String>,
pub mrl: bool,
pub layer_norm_after_pooling: bool,
pub license: String,
pub size_gb: f32,
pub gated: bool,
pub phase: u8,
pub backends: BackendSupport,
pub default_dtype: DType,
pub dtype_backends: DtypeBackendSupport,
}Expand description
Everything the library needs to know about a model beyond its weights. Build one with new, then assign fields.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: String§family: Family§dim: usize§default_max_length: usize§pooling: Pooling§normalize: bool§query_template: Option<String>§passage_template: Option<String>§default_instruction: Option<String>§dense_dirs: Vec<String>§mrl: bool§layer_norm_after_pooling: bool§license: String§size_gb: f32§gated: bool§phase: u8§backends: BackendSupport§default_dtype: DTypeThe dtype the builder loads when the caller sets none; BF16 on CPU falls back to F32.
dtype_backends: DtypeBackendSupportPer-dtype support on each device, derived from the entry’s statuses; every builder refuses from this row.
Implementations§
Source§impl ModelDescriptor
impl ModelDescriptor
Sourcepub fn new(
id: impl Into<String>,
family: Family,
dim: usize,
pooling: Pooling,
) -> Self
pub fn new( id: impl Into<String>, family: Family, dim: usize, pooling: Pooling, ) -> Self
The four facts with no safe default; the rest is what a snapshot outside the catalog starts from: 512 tokens, unit-length rows, no template or Dense module, F32, untested everywhere, and catalog fields marked unknown.
Trait Implementations§
Source§impl Clone for ModelDescriptor
impl Clone for ModelDescriptor
Source§impl Debug for ModelDescriptor
impl Debug for ModelDescriptor
Source§impl<'de> Deserialize<'de> for ModelDescriptor
impl<'de> Deserialize<'de> for ModelDescriptor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ModelDescriptor
impl PartialEq for ModelDescriptor
Source§impl Serialize for ModelDescriptor
impl Serialize for ModelDescriptor
impl StructuralPartialEq for ModelDescriptor
Auto Trait Implementations§
impl Freeze for ModelDescriptor
impl RefUnwindSafe for ModelDescriptor
impl Send for ModelDescriptor
impl Sync for ModelDescriptor
impl Unpin for ModelDescriptor
impl UnsafeUnpin for ModelDescriptor
impl UnwindSafe for ModelDescriptor
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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