Skip to main content

tensorlogic_train/lora/
error.rs

1//! LoRA-specific error types.
2
3use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum LoraError {
7    #[error("invalid rank: {0} (must be >= 1 and <= min(d, k))")]
8    InvalidRank(usize),
9
10    #[error("dimension mismatch: expected {expected}, got {got}")]
11    DimensionMismatch { expected: String, got: String },
12
13    #[error("merge error: {0}")]
14    MergeError(String),
15
16    #[error("frozen weights: {0}")]
17    FrozenWeights(String),
18}
19
20pub type LoraResult<T> = Result<T, LoraError>;