pub enum RuntimeError {
Show 20 variants
ModelNotLoaded,
TokenizerNotAvailable,
TokenizerError {
message: String,
},
SamplingError {
message: String,
},
KvCacheFull {
max_ctx: usize,
},
ModelLoadError {
message: String,
},
Cancelled,
Arch(ArchError),
Gguf(GgufError),
Quant(QuantError),
Io(Error),
Grammar(GrammarError),
AttentionError {
message: String,
},
SnapshotIncompatible {
detail: String,
},
ModelFingerprintMismatch {
expected: String,
found: String,
detail: String,
},
OffloadEof {
offset: u64,
needed: usize,
available: usize,
},
TensorNotFound(String),
LockPoisoned,
SpecSnapshotIncompatible(String),
EmptySequence,
}Expand description
Errors that can occur during inference.
Variants§
ModelNotLoaded
No model has been loaded yet.
TokenizerNotAvailable
Tokenizer is not available because neither tokenizer-wasm nor tokenizer-onig
feature is enabled.
Enable the tokenizer-wasm feature (default, pure Rust) to use
the HuggingFace tokenizers library.
TokenizerError
Tokenizer initialization or encoding/decoding failed.
SamplingError
Sampling operation failed.
KvCacheFull
KV cache has reached its maximum capacity.
ModelLoadError
Model file could not be loaded.
Cancelled
Generation was interrupted or cancelled.
Arch(ArchError)
Error propagated from architecture layer.
Gguf(GgufError)
Error propagated from GGUF parser.
Quant(QuantError)
Error propagated from quantization kernel.
Io(Error)
I/O error during model loading.
Grammar(GrammarError)
Grammar error from GBNF constrained sampling.
AttentionError
Attention computation error.
SnapshotIncompatible
Snapshot format version is incompatible with this runtime.
ModelFingerprintMismatch
Model fingerprint in snapshot does not match the file on disk.
Fields
OffloadEof
Offload pager read past end of backing store.
Fields
TensorNotFound(String)
A tensor name was not found in the weight offset map.
LockPoisoned
An internal RwLock or Mutex was poisoned.
SpecSnapshotIncompatible(String)
Speculative-engine snapshot format is incompatible with this runtime.
EmptySequence
Cannot pool an empty sequence (seq_len = 0).
Trait Implementations§
Source§impl Debug for RuntimeError
impl Debug for RuntimeError
Source§impl Display for RuntimeError
impl Display for RuntimeError
Source§impl Error for RuntimeError
impl Error for RuntimeError
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()
Source§impl From<ArchError> for RuntimeError
impl From<ArchError> for RuntimeError
Source§impl From<Error> for RuntimeError
impl From<Error> for RuntimeError
Source§impl From<GgufError> for RuntimeError
impl From<GgufError> for RuntimeError
Source§impl From<GrammarError> for RuntimeError
impl From<GrammarError> for RuntimeError
Source§fn from(source: GrammarError) -> Self
fn from(source: GrammarError) -> Self
Source§impl From<QuantError> for RuntimeError
impl From<QuantError> for RuntimeError
Source§fn from(source: QuantError) -> Self
fn from(source: QuantError) -> Self
Source§impl From<RuntimeError> for RewindError
impl From<RuntimeError> for RewindError
Source§fn from(source: RuntimeError) -> Self
fn from(source: RuntimeError) -> Self
Auto Trait Implementations§
impl Freeze for RuntimeError
impl !RefUnwindSafe for RuntimeError
impl Send for RuntimeError
impl Sync for RuntimeError
impl Unpin for RuntimeError
impl UnsafeUnpin for RuntimeError
impl !UnwindSafe for RuntimeError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more