pub struct ModelConfig {Show 15 fields
pub model: EmbeddingModel,
pub name: String,
pub hf_repo: String,
pub revision: Option<String>,
pub onnx_path: String,
pub vocab_file: VocabSource,
pub dimensions: usize,
pub max_seq_len: usize,
pub model_min_bytes: u64,
pub vocab_min_bytes: u64,
pub query_prefix: Option<String>,
pub document_prefix: Option<String>,
pub needs_token_type_ids: bool,
pub format: ModelFormat,
pub pinned_sha256: &'static [(&'static str, &'static str)],
}Expand description
Complete configuration for a single embedding model.
Fields§
§model: EmbeddingModel§name: String§hf_repo: String§revision: Option<String>Optional revision pin for custom models (None = main).
onnx_path: String§vocab_file: VocabSource§dimensions: usize§max_seq_len: usize§model_min_bytes: u64§vocab_min_bytes: u64§query_prefix: Option<String>Optional prefix prepended to queries before embedding.
document_prefix: Option<String>Optional prefix prepended to documents/code before embedding.
needs_token_type_ids: boolWhether the model expects token_type_ids input (BERT-style). Some models (e.g. nomic-embed) only use input_ids + attention_mask.
format: ModelFormatHow the weights are stored and run.
pinned_sha256: &'static [(&'static str, &'static str)](local file, sha256-hex) every download must match; empty means
trust-on-first-use via model.lock.json.
Implementations§
Source§impl ModelConfig
impl ModelConfig
Sourcepub fn local_model_file(&self) -> &'static str
pub fn local_model_file(&self) -> &'static str
File name of the weights inside the model directory.
Trait Implementations§
Source§impl Clone for ModelConfig
impl Clone for ModelConfig
Auto Trait Implementations§
impl Freeze for ModelConfig
impl RefUnwindSafe for ModelConfig
impl Send for ModelConfig
impl Sync for ModelConfig
impl Unpin for ModelConfig
impl UnsafeUnpin for ModelConfig
impl UnwindSafe for ModelConfig
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<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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