llama_cpp_bindings/error/fit_error.rs
1/// Returned by [`crate::model::params::LlamaModelParams::fit_params`].
2#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
3pub enum FitError {
4 /// No combination of model parameters fits the available device memory.
5 #[error("no parameter combination fits available memory")]
6 NoFittingMemoryLayout,
7 /// Parameter fitting was aborted by a hard error reported by the underlying library
8 /// (e.g., model file missing, backend initialization failed).
9 #[error("parameter fitting aborted")]
10 Aborted,
11 /// The fitting helper returned a status code the wrapper does not recognise.
12 #[error("parameter fitting returned an unknown status code: {code}")]
13 UnknownStatus { code: i32 },
14 /// Wrapper could not allocate memory for an error message.
15 #[error("not enough memory")]
16 NotEnoughMemory,
17 /// Generic exception caught at the wrapper boundary, with the underlying message.
18 #[error("{message}")]
19 Reported { message: String },
20}