Skip to main content

llama_cpp_bindings/error/
sample_error.rs

1use crate::error::sampler_apply_error::SamplerApplyError;
2use crate::error::token_to_string_error::TokenToStringError;
3
4#[derive(Debug, thiserror::Error, PartialEq, Eq)]
5pub enum SampleError {
6    #[error("not enough memory")]
7    NotEnoughMemory,
8    #[error("applying the sampler to the token data array failed: {0}")]
9    SamplerApply(#[from] SamplerApplyError),
10    #[error("token detokenization failed during classification: {0}")]
11    Detokenize(#[from] TokenToStringError),
12    #[error("the grammar sampler callback failed during sampling: {message}")]
13    GrammarCallbackFailed { message: String },
14    #[error("{message}")]
15    Reported { message: String },
16}