pub enum ModelTask {
TextEmbedding,
ImageEmbedding,
AudioEmbedding,
Classification,
Ner,
Regression,
}Expand description
What inference task a model performs.
The catalog persists this as a snake-case TEXT column; in-process call
sites should pass the enum directly. The
as_db_str / try_from_db_str
pair is the authoritative database mapping — Display, FromStr, and
serde all delegate to it so there is exactly one spelling per variant.
Variants§
TextEmbedding
Produce dense vector representations of input text.
ImageEmbedding
Produce dense vector representations of input images.
AudioEmbedding
Produce dense vector representations of input audio clips.
Classification
Assign a label and confidence score to input text.
Ner
Extract named entities (person, org, location, etc.) from text.
Regression
Predict a continuous outcome as a distribution — a Gaussian
(mean, std) or a set of quantiles — rather than a point. The
distributional decoder (DistributionAdapter)
and the proper-scoring objectives (NLL/CRPS/pinball) train and serve it.
Unlike S9’s similarity edge — a derivation over embeddings that earned
no variant — this is a genuine model output type, so it belongs in
Self::ALL and the resolution path.
Implementations§
Source§impl ModelTask
impl ModelTask
Sourcepub const ALL: &'static [ModelTask]
pub const ALL: &'static [ModelTask]
Every variant in declaration order. The single source of truth for
“what tasks exist” — ResultStore, the catalog SQL builders, and
any future caller that needs to fan over the full set must read it
here rather than re-listing variants. Kept consistent with the
enum body by all_covers_every_variant_via_exhaustive_match in
tests below.
Sourcepub fn as_db_str(&self) -> &'static str
pub fn as_db_str(&self) -> &'static str
Canonical snake-case string stored in the catalog. The single source
of truth — Display, FromStr, serde all route through this.
Sourcepub fn try_from_db_str(s: &str) -> Result<Self, JammiError>
pub fn try_from_db_str(s: &str) -> Result<Self, JammiError>
Decode the canonical snake-case string back into a ModelTask.
Unknown spellings raise JammiError::Other naming the offending
value and the accepted set.
Sourcepub fn is_embedding(&self) -> bool
pub fn is_embedding(&self) -> bool
true for the two embedding variants that participate in vector
search and ANN sidecar indexes; false for inference-only tasks.
Trait Implementations§
impl Copy for ModelTask
Source§impl<'de> Deserialize<'de> for ModelTask
impl<'de> Deserialize<'de> for ModelTask
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>,
impl Eq for ModelTask
impl StructuralPartialEq for ModelTask
Auto Trait Implementations§
impl Freeze for ModelTask
impl RefUnwindSafe for ModelTask
impl Send for ModelTask
impl Sync for ModelTask
impl Unpin for ModelTask
impl UnsafeUnpin for ModelTask
impl UnwindSafe for ModelTask
Blanket Implementations§
impl<T> Allocation for T
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Scalar for T
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.