Skip to main content

Bgem3InitOptions

Type Alias Bgem3InitOptions 

Source
pub type Bgem3InitOptions = InitOptionsWithLength<Bgem3Model>;
Available on crate feature onnx only.
Expand description

Options for initializing the Bgem3Embedding model

Aliased Type§

pub struct Bgem3InitOptions {
    pub model_name: Bgem3Model,
    pub environment: Option<Environment>,
    pub execution_providers: Vec<ExecutionProviderDispatch>,
    pub cache_dir: PathBuf,
    pub show_download_progress: bool,
    pub max_length: usize,
    pub intra_threads: Option<usize>,
    pub session_config: Vec<(String, String)>,
    pub auto_device: Option<AutoDevicePolicy>,
}

Fields§

§model_name: Bgem3Model§environment: Option<Environment>§execution_providers: Vec<ExecutionProviderDispatch>§cache_dir: PathBuf§show_download_progress: bool§max_length: usize§intra_threads: Option<usize>

Number of intra-op threads for ONNX Runtime. None (the default) uses every available CPU core via std::thread::available_parallelism. Set this to cap CPU usage (e.g. on laptops) at the cost of throughput.

§session_config: Vec<(String, String)>

ONNX Runtime session configuration entries, applied with SessionBuilder::with_config_entry. Use this for settings that have no dedicated builder method, such as mlas.disable_kleidiai.

§auto_device: Option<AutoDevicePolicy>

Policy for ONNX Runtime’s automatic execution provider selection, applied with SessionBuilder::with_auto_device. None (the default) keeps ort’s default, AutoDevicePolicy::MaxEfficiency, which registers CoreML on macOS. Some(AutoDevicePolicy::PreferCPU) never registers an execution provider automatically. Execution providers passed through execution_providers take precedence over automatic selection.