Skip to main content

llama_cpp_bindings/context/
load_seq_state_error.rs

1//! Error type for sequence state file load operations.
2
3use std::ffi::NulError;
4use std::path::PathBuf;
5
6/// Failed to load a sequence state file.
7#[derive(Debug, Eq, PartialEq, thiserror::Error)]
8pub enum LoadSeqStateError {
9    /// llama.cpp failed to load the sequence state file
10    #[error("Failed to load sequence state file")]
11    FailedToLoad,
12
13    /// null byte in string
14    #[error("null byte in string {0}")]
15    NullError(#[from] NulError),
16
17    /// failed to convert path to str
18    #[error("failed to convert path {0} to str")]
19    PathToStrError(PathBuf),
20
21    /// Insufficient max length
22    #[error("max_length is not large enough to hold {n_out} (was {max_tokens})")]
23    InsufficientMaxLength {
24        /// The length of the loaded sequence
25        n_out: usize,
26        /// The maximum length
27        max_tokens: usize,
28    },
29}