mod reader;
mod names;
mod loader;
pub use reader::{SafeTensorsFile, SafeTensorInfo, SafeTensorsDtype, ShardedSafeTensors};
pub use names::TensorNameMapper;
pub use loader::SafeTensorsLoader;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum SafeTensorsError {
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("JSON parse error: {0}")]
Json(#[from] serde_json::Error),
#[error("Invalid SafeTensors file: {0}")]
InvalidFormat(String),
#[error("Tensor not found: {0}")]
TensorNotFound(String),
#[error("Unsupported dtype: {0}")]
UnsupportedDtype(String),
}
pub type SafeTensorsResult<T> = Result<T, SafeTensorsError>;