Skip to main content

load_auto

Function load_auto 

Source
pub fn load_auto<M: DeserializeOwned>(
    path: impl AsRef<Path>,
    expected_type: ModelType,
) -> Result<M>
Expand description

Load a model with automatic strategy selection based on file size.

Files larger than MMAP_THRESHOLD use load_mmap; smaller files use load (lower overhead for small files).

§Errors

Returns an error on file-not-found, a format error, a type mismatch, or a checksum failure.