pub fn load<M: KnownModel>(
path: &Path,
params: ModelParameters,
load_progress_callback: impl FnMut(LoadProgress),
) -> Result<M, LoadError>
Expand description
Load a GGML model from the path
and configure it per the params
. The status
of the loading process will be reported through load_progress_callback
.
Note that the model must be a single-part model, and the model in path
must match the architecture of M
.
ยงPanics
-
If the model does not match the architecture of
M
. This is not checked before execution, so this function will panic if the model does not match the architecture.This is a limitation of the GGML format, which does not store any information about the architecture.