1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum Error {
6 #[error("failed to parse .nam JSON: {0}")]
8 Json(#[from] serde_json::Error),
9
10 #[error("failed to read .nam file: {0}")]
12 Io(#[from] std::io::Error),
13
14 #[error("unsupported model architecture: {0:?}")]
16 UnsupportedArchitecture(String),
17
18 #[error("unsupported activation function: {0:?}")]
20 UnsupportedActivation(String),
21
22 #[error("weight count mismatch: config implies {expected} weights, file has {found}")]
25 WeightCountMismatch { expected: usize, found: usize },
26}