pub struct SparseEmbeddingConfig {
pub model: SparseEmbeddingModelType,
pub batch_size: usize,
pub max_length: usize,
pub show_download_progress: bool,
pub cache_dir: Option<PathBuf>,
pub acceleration: Option<AccelerationConfig>,
pub max_embed_duration_secs: Option<u64>,
}Expand description
Configuration for the sparse-embedding pipeline.
Controls which model to use, batching, and download/cache behavior for the local ONNX SPLADE model.
Fields§
§model: SparseEmbeddingModelTypeThe sparse-embedding model to use (defaults to the “opensearch-v3-distill” preset).
batch_size: usizeBatch size for local ONNX inference.
SPLADE emits a [seq, vocab] logit tensor per document, so memory scales
with batch size — keep this modest.
max_length: usizeMaximum token sequence length for the tokenizer.
show_download_progress: boolShow model download progress (local ONNX path only).
When enabled, transfer progress for the model, tokenizer and config files is reported at
info level on the xberg::model_download target while they download (#279). A warm
Hugging Face cache transfers nothing and so reports nothing. Ignored by
SparseEmbeddingModelType::Plugin, which downloads no model.
cache_dir: Option<PathBuf>Optional alternate Hugging Face cache root for model files.
When unset, hf-hub follows the standard Hugging Face environment and platform cache conventions.
acceleration: Option<AccelerationConfig>Hardware acceleration for the sparse-embedding ONNX model.
max_embed_duration_secs: Option<u64>Maximum wall-clock duration (in seconds) for a single embed call when
using SparseEmbeddingModelType::Plugin. None disables the timeout.
Trait Implementations§
Source§impl Clone for SparseEmbeddingConfig
impl Clone for SparseEmbeddingConfig
Source§fn clone(&self) -> SparseEmbeddingConfig
fn clone(&self) -> SparseEmbeddingConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SparseEmbeddingConfig
impl Debug for SparseEmbeddingConfig
Source§impl Default for SparseEmbeddingConfig
impl Default for SparseEmbeddingConfig
Source§impl<'de> Deserialize<'de> for SparseEmbeddingConfig
impl<'de> Deserialize<'de> for SparseEmbeddingConfig
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>,
Auto Trait Implementations§
impl Freeze for SparseEmbeddingConfig
impl RefUnwindSafe for SparseEmbeddingConfig
impl Send for SparseEmbeddingConfig
impl Sync for SparseEmbeddingConfig
impl Unpin for SparseEmbeddingConfig
impl UnsafeUnpin for SparseEmbeddingConfig
impl UnwindSafe for SparseEmbeddingConfig
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
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>,
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 more