Skip to main content

llama_cpp_bindings/mtmd/
mtmd_tokenize_error.rs

1use crate::mtmd::mtmd_input_chunks_error::MtmdInputChunksError;
2
3#[derive(thiserror::Error, Debug)]
4pub enum MtmdTokenizeError {
5    #[error("Failed to create CString from input text: {0}")]
6    CStringError(#[from] std::ffi::NulError),
7    #[error("{0}")]
8    InputChunksError(#[from] MtmdInputChunksError),
9    #[error("number of bitmaps does not match number of markers in the text")]
10    BitmapCountDoesNotMatchMarkerCount,
11    #[error("media preprocessing failed (image or audio)")]
12    MediaPreprocessingFailed,
13    #[error("mtmd_tokenize returned an unknown status code: {code}")]
14    UnknownStatus { code: i32 },
15    #[error("not enough memory")]
16    NotEnoughMemory,
17    #[error("{message}")]
18    Reported { message: String },
19}