pub enum NormalizeError {
Backend(String),
Load {
path: PathBuf,
source: LlamaModelLoadError,
},
NotCausal {
path: PathBuf,
arch: String,
},
Context(LlamaContextLoadError),
Batch(BatchAddError),
Decode(DecodeError),
KvCache(KvCacheConversionError),
}Expand description
Everything the normalizer can fail with.
Variants§
Backend(String)
llama.cpp’s global backend refused to start. It is a process singleton, so the usual cause is another library in the same process having initialized it first.
Load
The weights could not be opened. crate::prepare checks size and
hash before anything reaches here, so a failure at this point is
usually a path that names no file.
NotCausal
The file is not a model this stage runs, refused BEFORE the load.
The check has to happen here, because the alternative is a process
abort. llama.cpp loads an encoder-decoder gguf without complaint and
then asserts inside the first decode on the cross-attention input a
causal decode never sets - llm_graph_input_attn_cross::set_input,
measured on a t5 build - and a ggml assert aborts rather than
returning, so nothing can catch it after the load. The architecture is
read out of the file’s own header first, and a file that declares none
is refused on the same grounds: an undeclared arch is a promise nobody
can make.
Context(LlamaContextLoadError)
A context could not be created for the loaded weights.
Batch(BatchAddError)
The batch would not hold the tokens offered to it.
Decode(DecodeError)
llama.cpp rejected a decode step.
KvCache(KvCacheConversionError)
Rejected draft tokens could not be dropped from the KV cache. Continuing would attend over tokens that were never emitted.
Trait Implementations§
Source§impl Debug for NormalizeError
impl Debug for NormalizeError
Source§impl Display for NormalizeError
impl Display for NormalizeError
Source§impl Error for NormalizeError
impl Error for NormalizeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()