pub enum LlamaError {
Show 15 variants
BackendAlreadyInitialized,
ModelLoad(String),
ContextCreation,
Nul(NulError),
InvalidPath,
Tokenize,
TokenToPiece,
TokenOutOfRange {
token: i32,
n_vocab: i32,
},
Decode(i32),
BatchOverflow {
capacity: usize,
index: usize,
},
TooManySeqIds {
got: usize,
max: usize,
},
NoLogits(i32),
MtpInit,
MtpBegin(i32),
MtpStep(i32),
}Expand description
Errors returned by the safe wrapper.
Variants§
BackendAlreadyInitialized
The global backend was already initialized (it is a process-wide singleton).
ModelLoad(String)
llama_model_load_from_file returned null for the given path.
ContextCreation
llama_init_from_model returned null.
Nul(NulError)
A path or prompt contained an interior NUL byte.
InvalidPath
The model path was not valid UTF-8 / could not be converted to a C string.
Tokenize
Tokenization failed (negative count from llama_tokenize).
TokenToPiece
Detokenization produced invalid UTF-8 that could not be recovered.
TokenOutOfRange
A token id was outside the model’s vocabulary range [0, n_vocab).
Handing it to ik’s tokenizer would abort the process (it does an
out-of-range std::vector::at), so it is rejected up front.
Decode(i32)
llama_decode returned a non-zero status.
BatchOverflow
A batch operation exceeded the batch’s allocated capacity.
TooManySeqIds
More sequence ids were supplied for a token than the batch’s n_seq_max.
NoLogits(i32)
Requested logits for a position that was not computed / out of range.
MtpInit
MTP speculative driver initialization failed (e.g. 0 NextN layers, or an
openPangu/recurrent target, or a context not created with .with_mtp(true)).
MtpBegin(i32)
MTP begin (prompt warmup) failed.
MtpStep(i32)
MTP step (draft/verify/accept/commit) failed.
Trait Implementations§
Source§impl Debug for LlamaError
impl Debug for LlamaError
Source§impl Display for LlamaError
impl Display for LlamaError
Source§impl Error for LlamaError
impl Error for LlamaError
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()