pub struct MtmdContextParams { /* private fields */ }Expand description
Parameters used when creating an MtmdContext.
Obtain a default-initialised instance via MtmdContextParams::default().
Implementations§
Source§impl MtmdContextParams
impl MtmdContextParams
Sourcepub fn use_gpu(self, v: bool) -> Self
pub fn use_gpu(self, v: bool) -> Self
Whether to run the vision/audio encoder on the GPU (default: true).
Sourcepub fn print_timings(self, v: bool) -> Self
pub fn print_timings(self, v: bool) -> Self
Whether to print timing info after each encode (default: false).
Sourcepub fn n_threads(self, n: i32) -> Self
pub fn n_threads(self, n: i32) -> Self
Number of threads used for the vision encoder (default taken from
mtmd_context_params_default).
Sourcepub fn warmup(self, v: bool) -> Self
pub fn warmup(self, v: bool) -> Self
Whether to run a warm-up encode pass after initialisation.
Sourcepub fn image_min_tokens(self, n: i32) -> Self
pub fn image_min_tokens(self, n: i32) -> Self
Minimum number of image tokens (0 = use model default).
Sourcepub fn image_max_tokens(self, n: i32) -> Self
pub fn image_max_tokens(self, n: i32) -> Self
Maximum number of image tokens (0 = use model default).
Sourcepub fn media_marker(self, marker: Option<&str>) -> Result<Self, MtmdError>
pub fn media_marker(self, marker: Option<&str>) -> Result<Self, MtmdError>
Override the media marker string (e.g. "<image>").
The provided string must not contain interior NUL bytes. Pass None
to use the library default (mtmd_default_marker()).
Note: the CString is stored inside the params so the pointer
remains valid as long as this MtmdContextParams lives.
§Errors
Returns MtmdError if the marker string contains a NUL byte.